[Gambas-user] Valuebox_Enter strange behaviour
Tobias Boege
taboege at ...626...
Sat Nov 1 12:18:55 CET 2014
On Sat, 01 Nov 2014, Alain Baudrez wrote:
> I use a valuebox for numbers and want to select to existing content upon
> entering the valuebox.
>
> I use the following code
>
> Public Sub vBoxQty_Enter()
> Desktop.SendKeys("{[Shift_L][End]}")
> End
>
> When entering the valuebox using the tab-key, the content is selected.
> When entering the valuebox with a mouseclick - what most people do -
> nothing happens. The cursor just blinks in the valuebox but the content is
> not selected.
>
> But .... move the mouse away from the valuebox and then back over the
> valuebox (without clicking) and the content automagically gets selected.
>
> By design or a bug?
>
By design and by documentation. The Enter event is raised when the mouse
enters the control, in the sense of hovering it.
GotFocus is just the right event for you here. The behaviour when <Tab>-ing
your way to the control is likely the toolkit's internal one.
Regards,
Tobi
--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
More information about the User
mailing list