Hi
I have three CheckBoxes each on new line and I have also one TextBox
myTextbox is invisible by default and I need to make it visible if I checked one of the checkboxes, but I need it to be shown parallel to the checkBox that I select.
Example, if I select CheckBox2, then myTextBox will be shown parallel to that checkBox2 only.
Also, I don't want to create 3 textboxes since I need to use the myTextBox value as a parameter for another function later.
CheckBox1 MyTextBox
CheckBox2 MyTextBox
CheckBox3 MyTextBox
Is it possible to achieve this?, I tried to use textbox.Top / textbox.Bottom but didn't work.
Loading
Rano AHPosted Sep 7, 2013, 3:10 PM
Try this:
if(CheckBox1.Checked == true)
{
TextBox1.Location = new System.Drawing.Point(241, 283);
TextBox1.Visible = true;
}
// Try to add the control to the location you need and then from the Control properties go to Location and use the same value for the point.
Hope it helps :-)
Cheers
Hind NajimPosted Sep 7, 2013, 8:30 AM
Hi
Well, my application form is the same as that you sent, but with only one TextBox, which is beside the checkBox1. So I have only one textbox which should be shown if one of the three checkboxes is checked. But the location of textbox will be changed. Example. if I select checkBox2, then the textbox will be shown beside it (Moved down), and same for checkBox3., if it's checked then textbox will be shown beside it (move down). If checkBox1 is checked then the location will be remain the same, but textbox will be visible.
I think moving the textboxes will be based on pixels, but cannot move it down, there some options for textbox.Top or textbox.Left..
Sanjeeb LenkaPosted Sep 7, 2013, 6:22 AM
i didn't get your point. plz attached a sample so i can able to understand.
Hind NajimPosted Sep 7, 2013, 4:32 AM
Yes, this is true and can be achieved if you have multiple textboxes, each is parallel to the checkbox, but I don't want to have multiple textboxes, I want only one textbox which is invisible by default and this textbox will be turned to visibility state but parallel to the checkbox that I selected only. Not sure if a textbox control can be moved from one location to another.
I can turn it to visible state but I cannot change the location of the textbox to be parallel to the selected TextBox
Sanjeeb LenkaPosted Sep 7, 2013, 3:45 AM
check the attached sample.
Hind NajimPosted Sep 7, 2013, 3:33 AM
Sanjeeb LenkaPosted Sep 7, 2013, 3:15 AM
its in windows or in web