this is my button click event
-----------------------------------------
foreach (RadioButton obj in PanelControl2.Control.Controls)
{
MessageBox.Show(obj.Name); <----------------i got value: ""
MessageBox.Show(CustomerID.Name);<------i got value:CustomerID
if(obj.Checked)
{
var = obj.Name;
break;
}
}
---------------------------------------
CustomerID is a Radio Button
How can i got name when i use foreach?
and
If I dont want the form1.show how to do can let buttonOk click event in form1.load?
How can I get control's Name in form
-
- Posts: 68
- Joined: Tue Feb 09, 2010 3:16 am
- Location: Taiwan
How can I get control's Name in form
Hello,
Use the following code:
Thank you.
Use the following code:
Code: Select all
foreach (StiRadioButtonControl obj in PanelControl1.Components)
{
MessageBox.Show(obj.Name);
if(obj.Checked)
{
var = obj.Name;
break;
}
}
How can I get control's Name in form
Hello,
Form1.Visible = false;
Thank you.
ButtonControl1_Click(null, EventArgs.Empty);RickyHuang wrote: If I dont want the form1.show how to do can let buttonOk click event in form1.load?
Form1.Visible = false;
Thank you.
-
- Posts: 68
- Joined: Tue Feb 09, 2010 3:16 am
- Location: Taiwan
How can I get control's Name in form
it can work...
thanks a lot..:feelgood:
thanks a lot..:feelgood:
How can I get control's Name in form
Great! Have a good day!