fmartinez78ovi
Member
- Joined
- Sep 14, 2020
- Messages
- 11
- Programming Experience
- 5-10
Hello group,
I am trying to display combobox text value using a groupbox reference.
CmbR1 is inside of my groupbox named GroupBox6, when I try to run next piece of code I am getting a Reference null error:
My piece of code is as follow:
I have a group of comboboxes from CmbR1 to CmbR9 inside of GroupBox6.
Any help, will be really appreciated.
Kind regards,
Francisco Mtz.
I am trying to display combobox text value using a groupbox reference.
CmbR1 is inside of my groupbox named GroupBox6, when I try to run next piece of code I am getting a Reference null error:
My piece of code is as follow:
C#:
GroupBox GroupBox6 = new System.Windows.Forms.GroupBox();
for (int i = 1; i <= 9; i++)
{
MessageBox.Show(GroupBox6.Controls["CmbR" + i].Text);
}
Any help, will be really appreciated.
Kind regards,
Francisco Mtz.
Attachments
Last edited by a moderator: