Focus Doesn't Work With Splitter Panel

D

DIOS

I tried doing a search in Google but couldn't come up with anything on
this issue. Using VB.NET2005 I have a form with various controls
including a splitter panel. I've set the tab order such that my
textbox is tabindex 0 and have also set the textbox to focus in both
the form load and form activate events. No matter what i do the
splitter panel always gets the default focus. if i delete the splitter
panel out of my form then the focus goes to the textbox. Is this a
bug, a mistake on my part, or am I going crazy?

tia
AGP
 
R

Rich P

One thing I have noticed with .Net is that various controls can have the
same tab index and the app still compiles. I would set the tab index of
your splitter to some large number (larger than a single digit) like 801
or 1001 (I add an extra 1 to make sure it is unique). Then go through
all your controls and check the tab indexes to make sure you don't have
duplicate tab indexes. That will cause tabbing to not work as
advertised. It is a pain but the only workaround I have come up with
(if you already have a lot of controls - well - bummer man! :).

Rich
 
A

AGP

Already tried that. I have about 10 controls and the splitter panel is index
99.
still no joy.

AGP
 
R

Rich P

Build a test form and add one panel to it - dock the panel to the top of
the testform. Then add one textbox to this panel. Make sure the
tabindex of the panel is like 300 and set the tabindex of the textbox to
0. Now add a splitter and dock it top - so it ends up just under the
panel. Make sure its tabindex is 500. Now run the form and see what
control has the focus on startup. If this form works - then copy all
your controls and code over to it from the other form. Sometimes it is
just something so obscure in a form that you will never find/fix it. So
I start over from scratch.

Rich
 
A

AGP

It turns ou a third-party control in the splitpanel makes this behavior
happen.
Ill look at it some more.

AGP
 

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

Similar Threads


Top