[Gambas-user] SetFocus on DataBrowser

nospam.nospam.nospam at ...626... nospam.nospam.nospam at ...626...
Sun Nov 22 21:23:13 CET 2009


Charlie Reinl wrote:
> Am Sonntag, den 22.11.2009, 23:05 +1100 schrieb
> nospam.nospam.nospam at ...626...:
>> Charlie Reinl wrote:
>>> Am Sonntag, den 22.11.2009, 22:06 +1100 schrieb
>>> nospam.nospam.nospam at ...626...:
>>>> Toni wrote:
>>>>> Hi there,
>>>>> 
>>>>> I think it's got to do with the order that events fire... In any
>>>>> case, if you use the event "GotFocus" of the TabStrip, it should
>>>>> work as you expect.
>>>> 
>>>> Ok, that's far better than it was, many, many thanks. However after
>>>> moving the code into GotFocus the first row of the DataBrowser is
>>>> never highlighted. When the down arrow is pressed first on entering
>>>> the tab, the second row is highlighted, even though the first was
>>>> not highlighted. When the up arrow is pressed first on entering the
>>>> tab, the first row highlights.
>>>> 
>>>> <squint>
>>>> 
>>>> I see no methods available that will allow me to force the first
>>>> row to highlight :(
>>>> 
>>>> I tried moving rows and refreshing the datasource. I still can't
>>>> get that first row to highlight.
>>>> 
>>>> I could send fake keyboard events to fix it but that's hardly
>>>> kosher. 
>>> 
>>> Salut,
>>> 
>>> in you example give     DataBrowser1.GridView.Rows[0].Selected =
>>> TRUE a chance but inot in GotFocus, that raise when start the form.
>>> SET it in Tab_Click.
>> 
>> Well, that highlighted the first row all right, but now the
>> DataBrowser will not accept keystrokes unless I click first, which
>> is the same problem I had originally except that the the first row
>> is now highlighted. 
> 
> Salut
> 
> yes highlighted is not having the focus, so add just
> DataBrowser1.GridView.SetFocus
> that should do it.

And do it, it did. Thank you very much. Appreciated.




More information about the User mailing list