Yikes!  I've never seen that before.  Although the behaviour you describe
sounds somewhat reminiscent of what Windows Forms validation does - are you
using validation in this application?

So can I ask you to clarify a few things?  When you say 'custom controls',
do you mean a control that derives directly from
System.Windows.Forms.Control?  I'm not quite sure because you then go on to
talk about a user control as well.

Remember that UserControl derives from ContainerControl, and it is
ContainerControl that provides focus management logic in Windows Forms.
(Form derives from it too.)

I'm trying to understand the nesting of your controls. So far I've got this:

Form
|-UserControl
|  |-Panel
|  |  |-TextBox
|  |  |-Other controls?...
|  |
|  |- Other controls?...
|
|- Other controls?...

Is that right so far?  What are the other controls?  Where does the custom
control you mention fit into all of this?  (Don't send a screenshot to the
list -  I'm fairly sure that the LISTSERV will reject the attachment, and
even if it doesn't sending bitmaps to mailing lists never tends to be
popular.)

--
Ian Griffiths
DevelopMentor

----- Original Message -----
From: "Jim Galasyn" <[EMAIL PROTECTED]>

Greetings, I'm looking at some custom controls developed by another guy
who's very busy, and I have the task of figuring out what's wrong with
tabbing behavior on a complex form with custom controls.  What's happening
is that when a control (say, a text box) has focus, and I tab out of it,
unexpected controls receive the focus. This is complicated by the fact that
the common controls are hosted inside a user control which contains a panel,
on which the child controls are hosted (this aids immensely at design time
in the Forms Designer).

What I see, specifically, is this: the first attempt to tab out of the child
text control fails -- focus is set back to the text control. The second
time, focus goes to the next control in tab order. The third time, focus
goes to the following control in tab order. And so on, until focus comes all
the way around the tab order back to the original control.

Has anybody seen this kind of behavior before? I can send along a screen
shot from Spy++ if necessary.

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to