Experts - Very strange - Focus from one object to another

G

Guest

Hi,

I've a strange problem in my form. I have a textBox which i want to get the
focus when the form is loaded, so i gave it TabIndex=1 and on the load method
i wrote textBox1.Focus(). I have two more dataGrids which i was able to move
from one to another by clicking Enter, then i wanted to move from DataGrid2
to another textbox i have, and i couldn't. i tried to change the TabIndexs of
all the objects, and what i got is that now nothing works! I lost the focus
of textbox1, i can't make the focus to move from dataGrid2 to the last
textBox. WHAT CAN I DO?

Do i have to set the TabIndex, is there a way fix this problem?

Thanks,
Gidi.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Gidi said:
Hi,

I've a strange problem in my form. I have a textBox which i want to get
the
focus when the form is loaded, so i gave it TabIndex=1 and on the load
method
i wrote textBox1.Focus(). I have two more dataGrids which i was able to
move
from one to another by clicking Enter, then i wanted to move from
DataGrid2
to another textbox i have, and i couldn't.

How are you trying to move from the grid to the textbox? if by pressing TAB
then you should set your TabIndex accordingly

i tried to change the TabIndexs of
all the objects, and what i got is that now nothing works! I lost the
focus
of textbox1, i can't make the focus to move from dataGrid2 to the last
textBox. WHAT CAN I DO?

The TabIndes should work fine, alone. It seems that you are intercepting
some events from some of the controls and using Focus , this may interfere
with the flow that TabIndex provide
 

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