CheckBox Control
-
I will tell clearly my doubt here.When selecting the check box,i've to visible 2 text boxes.For that i need the code.Can any of you give me the code.
Babu
-
I will tell clearly my doubt here.When selecting the check box,i've to visible 2 text boxes.For that i need the code.Can any of you give me the code.
Babu
Hello Handle the CheckedChanged event, then this:
///////////////////////////////////////////
//Welome to English2C# translation script//
///////////////////////////////////////////private void MyCheckBox_CheckedChanged(object sender, EventsArgs e)
{
if(MyCheckBox.Checked)
{
MyTextBoxA.Visible = true;
MyTextBoxB.Visible = true;
}
else
{
MyTextBoxA.Visible = false;
MyTextBoxB.Visible = false;
}
}That's it!:-D So, where is the question now??:-> Regards:rose: -- modified at 7:30 Wednesday 23rd August, 2006
-
Hello Handle the CheckedChanged event, then this:
///////////////////////////////////////////
//Welome to English2C# translation script//
///////////////////////////////////////////private void MyCheckBox_CheckedChanged(object sender, EventsArgs e)
{
if(MyCheckBox.Checked)
{
MyTextBoxA.Visible = true;
MyTextBoxB.Visible = true;
}
else
{
MyTextBoxA.Visible = false;
MyTextBoxB.Visible = false;
}
}That's it!:-D So, where is the question now??:-> Regards:rose: -- modified at 7:30 Wednesday 23rd August, 2006
or even simpler
/////////////////////////////////////////// //Welome to English2C# translation script// /////////////////////////////////////////// private void MyCheckBox_CheckedChanged(object sender, EventsArgs e) { MyTextBoxB.Visible = MyTextBoxA.Visible = MyCheckBox.Checked; }
-
I will tell clearly my doubt here.When selecting the check box,i've to visible 2 text boxes.For that i need the code.Can any of you give me the code.
Babu
I guess telling you to set the Visible property on a textbox wasn't clear enough for you ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
or even simpler
/////////////////////////////////////////// //Welome to English2C# translation script// /////////////////////////////////////////// private void MyCheckBox_CheckedChanged(object sender, EventsArgs e) { MyTextBoxB.Visible = MyTextBoxA.Visible = MyCheckBox.Checked; }
Hey!! I like fancy long codes!:cool: Regards:rose: