|
From: Alexander S.K. <al...@be...> - 2014-01-30 09:39:17
|
Paulo Flecha writes:
> a Dialog with ON INIT and SetFocus doesn't work
> (Get or combobox)
>
> In the sample the focus is still at the first Get
> clicking on the button "SetFocus 2" works fine
The ON INIT isn't an appropriate place to set focus to some control -
Winapi set it itself later while initialization procedure.
So, put it to the onActivate block:
oDlg:Activate( ,,,.t.,{|| hwG_SetFocus(oGet[2]:handle)} )
Have in mind, that this codeblock is called, if the main window
exists ( I didn't investigate the reason yet, the winapi is full of such
strange features ), so in your sample, where the dialog is the only
window, it won't work.
>
> and Using ON CHANGE
> the message keeps appearing when the control getfocus
>
> In hedit.prg adding IF bGfocus != Nil it seems to solve the "ON CHANGE" problem
> line 80
Thanks for the tip, I'll fix this.
Regards, Alexander.
|