Textbox and Focus

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.
 
G

Guest

Textbox's parent is form. Based on selected row of datagrid, I change the
location of textbox to make grid editable.
 
P

PZ

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
 
G

Guest

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

I appreciate your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top