PDA

View Full Version : set.pos help!!


mz241508
11-19-2006, 02:17 PM
does any one know how set the position of a button in the middle.

yosik
11-19-2006, 11:49 PM
wndHandle = Application.GetWndHandle();
windowSize = Window.GetSize(wndHandle);
yourButtonSize = Button.GetSize("yourButtonName");
Button.SetPos("yourButtonName", (windowSize.Width/2)-(yourButtonSize.Width/2), (widowSize.Height/2)-(yourButtonSize.Height/2));


Good luck

Yossi

Roboblue
11-20-2006, 12:49 AM
If you mean center the button in the middle of the AMS window, you can right click on the button, goto Align-click on to page-click center horizontal-click center verticle. This will do it in design time
What yosik said will do it at runtime.

mz241508
11-20-2006, 10:05 AM
thanks yosik!!

Intrigued
11-20-2006, 11:02 AM
I have also done up an example that shows how to creat objects that "stay put" when you resize the window at run-time.

This may be of interest as well, at some point:

http://www.indigorose.com/forums/showthread.php?t=17750&highlight=stay+put