I am using .net winforms.
I am having groupBox it contains set of controls like textbox,dropdown....
How to control the filds which is avilable in groupBox?
Example:
I need to clear all the contol fields.
I am using .net winforms.
I am having groupBox it contains set of controls like textbox,dropdown....
How to control the filds which is avilable in groupBox?
Example:
I need to clear all the contol fields.
You will have to write all the code as normal, but you might be able to use a loop for certain things as shown in this code (note, this code is just to show the structure, it's not going to compile as is):
foreach(Control ctrl in groupbox1.Controls)
{
if(typeof ctrl is TextBox)
{
ctrl.Text = "";
}
elseif // listview
{
ListView l = ctrl as ListView;
l.Items.Clear()
}
}
It might be worth creating your own user control that contains the groupbox with all the other controls inside, so that you don't end up with too much code in one form.