I am currently writing a C++ program (Mastermind) involving GUI.
I created several buttons in a groupbox.let's say Groupbox1
in each button, i inserted an image on it by setting image in properties.
After this, i created another groupbox .Groupbox2 here, there are many invisible buttons created by an array.
What i want to do is by pressing the buttons in Groupbox1, the buttons in Groupbox2 will be invisible, and display the image of the button pressed in Groupbox1. The purpose of having Groupbox2 is to show the option of the user only.
Also, another Groupbox, Groupbox3 here, Same as Groupbox2, there are a lot of invisible buttons generated by arrya.By pressing button "enter" the options selected in Groupbox2, the 4 buttons in Groupbox3 will appear and display the 4 buttons, including the images, in Groupbox3. This groupbox serves as the previously entered record of users.
The whole program was successfully compiled. Unfortunately, the image display on the buttons in Groupbox2 and Groupbox3 are in Black, White and Grey only, but not the colourful one buttons in Groupbox1.
Here is the general flow of program, though the function and variable may not be accurate.
this->gp1_button1->Image = (cli::safe_cast<System:rawing::Image^ >(resources->GetObject(L"gp1_button1.Image"));
int button_selected;
gp2_button [1]-->image = gp1_button[button_selected] -->image;
gp3_button-->image = gp2_button-->image;
is there any problem behind this??Any wrong setting in properties of the buttons or picture?? Or any thing wrong in the Code?
Or can i simply copy and paste the buttons in Groupbox by an array to Groupbox 2 and Groupbox3??
Sorry for the messy stuff here, it's hard to fully present the idea of the program..if you have any questions regarding this program, please feel free to leave comment and i would reply as soon as possible. Thanks a lot!