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

------------------------------------------------------------------------------
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to