TextField: How do I set the Top/Left properties of a textField at runtime?
- Drag and drop a textField and a button onto the page.
- Double click on the button to go to the button1_action method.
- Type the following line of code in the button action method
textField1.setStyle("left: 100px; top: 100px; position: absolute");
Note: Make sure the values you are giving for left and top positions are different from the ones currently.
- Save and run the application.
- When the page loads click on the button. You will notice that the position of the textField changes once the page is rendered again.