From: Wan Andii on 7 Jan 2010 01:16 I have two MDI Child forms that are created in a MDI Parent. Here is the issue when switching between the two child forms by clicking anywhere on the child forms (Not just their titlebars) the input focus shifts but the forms do not get the focus (bringtofront). Also under MDI 'Window Menu' the forms do not have the correct check order. The childforms have panels, groups, textboxes etc. Perhaps I'm going about this the wrong way Any feedback is appreciated. Thanks in advance - Wan --------------------------------- Public mMDIParent As Form (in datamodule) ' --- In MDI form (on load event)... Dim form1 As New Form1 form1.MDIParent = Me mMDIParent = Me form1.Show() ' --- In form1 (on button click event)... Dim form2 As New Form2 form2.MDIParent = mMDIParent form2.WindowState = FormWindowState.Normal form2.Show() run the application...
From: OmegaSquared on 7 Jan 2010 20:08 Hello, Wan, When I try your code (with simple forms - no panels, groups or textboxes, etc.) I do not have the problem you describe. Perhaps something in other code is interfering with the activation of the forms. Or another possibility... What version are you using? Your description sounds similar to a problem I experienced under VB2003 that I could only correct by upgrading to VB2005. Cheers, Randy "Wan Andii" wrote: > I have two MDI Child forms that are created in a MDI Parent. Here is > the issue when switching between > the two child forms by clicking anywhere on the child forms (Not just > their titlebars) the input focus shifts but the forms do not get the > focus (bringtofront). Also under MDI 'Window Menu' the forms do not > have the correct check order. The childforms have panels, groups, > textboxes etc. Perhaps I'm going about this the wrong way > Any feedback is appreciated. Thanks in advance > - Wan > > --------------------------------- > Public mMDIParent As Form (in datamodule) > > ' --- In MDI form (on load event)... > Dim form1 As New Form1 > form1.MDIParent = Me > mMDIParent = Me > form1.Show() > > ' --- In form1 (on button click event)... > Dim form2 As New Form2 > form2.MDIParent = mMDIParent > form2.WindowState = FormWindowState.Normal > form2.Show() > > run the application... > . >
From: Wan Andii on 8 Jan 2010 01:08 Thanks Randy for the feedback. I'm using VB2005. If I use the form1 & form2 with out the MDI then clicking anywhere on the forms works fine. Also I tried with new MDI form and still the same issue. I checked load & activate events on these child forms and didn't find anything that might be interfering with the activation. Thanks - Wan
From: OmegaSquared on 9 Jan 2010 19:00 Hello, Wan, If you replace the "real" child forms you are using with trivial forms (i.e. no controls other than the button on Form1 that is used to show Form2, and no additional code on either form) does the problem still occur? Cheers, Randy
From: Wan Andii on 10 Jan 2010 02:29 Thanks Randy for your time. Yes, I tried this suggestion a couple of days and narrow down the problem. Here is what I found: if trivial forms contain a group box and a button then application works fine. However, the problem comes back when I add (copy/paste) "TabControl" from the "real' child form to the test form. Hopefully this finding would help someone to solve this issue. Thanks Wan.
|
Next
|
Last
Pages: 1 2 Prev: LINQ: Dynamic Order By clause Next: installing sql server 2008 express |