[Gambas-user] ValueBox: Is the LostFocus event raised when the focus is changed programmatically? or see more.
Bruce
adamnt42 at gmail.com
Tue Jun 2 03:21:03 CEST 2020
On 1/6/20 7:28 pm, Benoît Minisini wrote:
> Le 01/06/2020 à 09:25, Bruce a écrit :
>> i.e. I have a ValueBox1_LostFocus event handler that does execute when
>> the user clicks on another input control but if they click on a button
>> it doesn't? So I put AnotherTextBox.SetFocus in the button handler.
>> The ValueBox1_LostFocus event handler still doen't execute.
>>
>> Any clues?
>
> As usual, show us a project that reproduces the problem.
>
Will do, but it is a bit difficult to extract. I have found one clue
though. The valuebox is in a custom composite control, the button is on
the form in a project that uses the control. So I guess that within the
composite control the focus is still on the valuebox.
(Composite control = a custom control that uses a Form with 3 textboxes
and a valuebox as it's visual representation.)
The more I think about this, the more it makes sense. But it is an
interesting take on the whole Focus situation. i.e when a custom control
loses focus then should all its' children also lose focus? I don't know
maybe that would upset things.
I'll have to build demo from scratch to demonstrate the problem.
b
More information about the User
mailing list