Textbox and Focus

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using Resco.Net's AdvancedList control as data grid. The tab control is
at the top of datagrid in screen layout. Tab control is being used to display
different when tab index is changed. Textbox makes data grid an editable
grid. The focus is on textbox when form is loaded. The focus is set in form
activate event handler. (Textbox gets focus when form is loaded first time.)
Datagrid is refreshed on each tab index change. At this point, textbox’s
focus method is not able to set focus on textbox. Can somebody explain this
behavior?

I searched the newsgroup for similar posting but didn’t find answer to the
behavior.
 
Textbox's parent is form. Based on selected row of datagrid, I change the
location of textbox to make grid editable.
 
It seems like TabControl is taking focus away after returning from
SelectedIndexChanged handler.

You can set focus for TextBox after returning from SelectedIndexChanged
using PostMessage (Microsoft.WindowsCE.Forms.MessageWindow.PostMessage
or P/Invoke).

Pavol Zajac, Resco
 
Thanks again Pavol. The other approach is to trap tabcontrol got focus event
and set focus on text box.

I appreciate your help.
 
Back
Top