Change TextBox Location Dynamicly

To place a textBox right after a textBox with the set CanGrow (CanShrink)property, it is needed to define a size of the first textbox after rendering. You can do that using the Prepare method:



textBox1.Prepare();

And then place the second textbox right after the first one:

textBox2.Location = textBox1.Location + new Vector(0, textBox1.RenderHeight);

You can do that in the GenerateScript property of the Detail element where they both are located.

Add Feedback