Consider please a Form with two controls on it.
On the left is any control - say, a TextBox.
On the right is another TextBox.
LeftTextBox anchoring is Stretch Down.
RightTextBox anchoring is Stretch Down and Across.
I'd like to show/hide LeftTextBox, the effect being that the control is either "expanded" or "collapsed".
This requires that I move RightTextBox - by changing its .Left property, in effect, moving it to the left to occupy the space previously consumed by the now hidden LeftTextBox.
I am now left with doing something about the width of RightTextBox. I can calculate an appropriate width and apply it, but then the control doesn't behave very well when resizing the Form.
It seems to me that it would all work brilliantly if I could somehow simply re-apply the anchoring of RightTextBox, after moving it.
Do any of you have experience doing such things and have any tips?
On the left is any control - say, a TextBox.
On the right is another TextBox.
LeftTextBox anchoring is Stretch Down.
RightTextBox anchoring is Stretch Down and Across.
I'd like to show/hide LeftTextBox, the effect being that the control is either "expanded" or "collapsed".
This requires that I move RightTextBox - by changing its .Left property, in effect, moving it to the left to occupy the space previously consumed by the now hidden LeftTextBox.
I am now left with doing something about the width of RightTextBox. I can calculate an appropriate width and apply it, but then the control doesn't behave very well when resizing the Form.
It seems to me that it would all work brilliantly if I could somehow simply re-apply the anchoring of RightTextBox, after moving it.
Do any of you have experience doing such things and have any tips?