How to load a form without radiobutton selected in C++ Winforms?

José Carlos 886 Reputation points
2023-04-13T14:54:33.3566667+00:00

Friends, I have a doubt, although I have tried many times and got no result. I have a grouBox with 10 radiobutton. When I load the program, radiobutton 1 is always selected. I need no radiobutton to be selected. I tried with the following code but it didn't work. Where would the problem be? I put this code in frmload.

			for each (Control ^ ctl in groupBox1->Controls)
			{
				RadioButton^ rb = dynamic_cast<RadioButton^>(ctl);
				if (rb->Checked)
					rb->Checked = false;
			}
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,688 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,561 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 82,036 Reputation points
    2023-04-13T15:22:54.75+00:00

    Like in another thread, it works for me in Form1_Shown

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful