Hi Ian, thank you for diving in. The code provided by David Mays over on
DOTNET-WINFORMS demonstrates the odd behavior nicely, although our
situation is rather more complex, as described below.
On Tue, 11 Jun 2002 10:31:42 +0100, Ian Griffiths <[EMAIL PROTECTED]>
wrote:
>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?
Not explcitly, in the sense of handling the Validating and Validated
events -- we're not even sure we fully understand those events!. We are
planning on handling them, but since they seem to be related to our tabbing
and focus issues, we want to resolve the tabbing/focus issues before
muddying the waters further.
>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.
By custom control we mean an aggregation of common controls nested within a
derivation from UserControl in order to create what appears to be a single
custom control. We never derive direclty from Control.
[snip]
>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?...
>
Our simplest case is:
UserControl
|-Panel
|-TextBox
|-Label
The most complicated case is:
UserControl
|-Panel
|-Button
|-Button
|-Button
|-Panel
|-TextBox
|-Label
Where we've shown common controls, in some cases we have a derived class to
make small modifications to OnPaint (e.g., we've overridden border drawing
in some panels). The derived classes are simple; we don't think we've done
anything to disturb the tab order.
Thank you for any insights!
Jim Galasyn
>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.
You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.