i use a screen that has one field that i enter data into and a button the when pressed will save this data and then i go to another screen. when i come back to the screen with one field and one button the location of activity is still on the button. since i use this screen alot i would like to have the position at the beginning of the screen each time i visit it. how do i do this? thanks.
2. Re: field positioning
#1162
Posted by: 2004-02-08 22:44:39
add this to the start of your program;
Declare Function SetFocus Lib "user32" Alias "SetFocus" (ByVal hwnd As Long) As Long
then when the button is pressed use
SetFocus(object)
where object is the thing you want to set the focus to.
One point; if you set focus to a Qedit any text in that QEdit will be selected automatically, it won't be removed, so you might want to clear its contents too.