Search Results

Search found 2 results on 1 pages for 'mangoman13'.

Page 1/1 | 1 

  • How to create an array of buttons in C++

    - by mangoman13
    Hi, I'm using C++ in VS2005 and have an 8x8 grid of buttons on a form. I want to have these buttons in an array, so when I click on any of them it will open the same event handler (I think that is what they are called), but I will know the index of which one was clicked on. I know how to do this in VB and C#, but I can't seem to figure it out with C++ Right now I have all my buttons labelled by their location, i.e. b00, b10, b21, etc. So I think what I am looking for is a way to do something like this: Button b[8][8]; //this causes me errors (error C2728: 'System::Windows::Forms::Button' : a native array cannot contain this managed type) and (error C2227: left of '->{ctor}' must point to class/struct/union/generic type) void Assignment(){ b[0][0] = b00; b[1][0] = b10; ... } and then in form1.h: private: System::Void b_Click(System::Object^ sender, System::EventArgs^ e) { //somehow read the coordinates into variables x and y //do something based on these values } Any help would be appreciated. Also let me know if I am going in the complete wrong direction with this. Thanks!

    Read the article

  • What is the easiest way to create a clickable grid for a game in C++?

    - by mangoman13
    I haven't used C++ in a while, so I decided to take on a small project to become familiar with it again. I am trying to make a chinese checkers game, but I have no experience with GUI design in C++. Is there a real simple way to just make grid (i.e. bitmap hexagons or something) that when clicked on, will give me the index number of the one I've clicked on? If someone has any examples of how to do this, even with just a 2D grid of squares, that would be helpful. Any help is appreciated, thanks!

    Read the article

1