C++/CLI -- Where to declare pre-selected list box and radio button attributes?
-
listBox1->SelectedItem = "---- SELECT! ----";
listBox2->SelectedItem = "---- SELECT! ----";
radioButton1->Checked = true;
radioButton2->Checked = true;Hi guys, I need my application to start with some pre-selected items in the list boxes and radio buttons, and I can achieve this by manually pasting the code above between the lines of the code which is automatically generated by VS2008 (using Windows Forms). By doing this the program works however the GUI Design page gets really screwed up and I loose the ability to make any further editing! Where do these attributes have to be inserted? I have tried in the main{} section but it returns an error. Help please!!
-
listBox1->SelectedItem = "---- SELECT! ----";
listBox2->SelectedItem = "---- SELECT! ----";
radioButton1->Checked = true;
radioButton2->Checked = true;Hi guys, I need my application to start with some pre-selected items in the list boxes and radio buttons, and I can achieve this by manually pasting the code above between the lines of the code which is automatically generated by VS2008 (using Windows Forms). By doing this the program works however the GUI Design page gets really screwed up and I loose the ability to make any further editing! Where do these attributes have to be inserted? I have tried in the main{} section but it returns an error. Help please!!
In general, you shouldn't edit any designer-generated code. I don't do Windows Forms, but I believe typically you'd do those kinds of initializations in response to the Load event. You can add event handlers from the properties pane for your form and or controls. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
In general, you shouldn't edit any designer-generated code. I don't do Windows Forms, but I believe typically you'd do those kinds of initializations in response to the Load event. You can add event handlers from the properties pane for your form and or controls. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java: