Re: Multiple MDI Child Icons and Control Boxes Why??
From: Siv (msnewsgroups_at_removeme.sivill.com)
Date: 01/17/05
- Next message: Larry Woods: "Test for multiple application executions (VB.NET)?"
- Previous message: Larry Woods: "Re: How do I refer to Startup Form Controls from another form."
- In reply to: Brian Schwartz: "Re: Multiple MDI Child Icons and Control Boxes Why??"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 17 Jan 2005 13:23:15 -0000
Brian,
I think you are right and this may be why I was having troubles as the
resizing that goes on in the background was causing some sort of cascading
effect that was:
a) messing up the display of control boxes and icons.
be) probably slowing the system quite a bit.
One thing that I have gleaned from other posts here on the subject of MDI is
that MS are now tending towards SDI applications and using "tabbed forms".
When people refer to tabbed forms do the mean a sdi form with a tab control
and then each page of the application is accessed using the tabs?
I have a problem with that sort of thing as a lot of my customers want multi
page databases that have literally hundreds of text boxes, drop lists,
lists, grids etc and if I tried to load all of that on one SDI form the
resource hit would be massive. With an MDI app at least you can load a
form, use it, and then close it as you move to the next page so that the
resource levels stay reasonable. Or am I missing the point, is there some
way to dynamically load the tabs with a form as the user uses them??
-- Siv Martley, Near Worcester, UK. "Brian Schwartz" <brian@fishnetcomponentswos.com> wrote in message news:eMpwDX1%23EHA.2032@tk2msftngp13.phx.gbl... > If I'm not mistaken... > > If your start form is not maximized, but you bring up another MDI child > that > is, the start form will also be maximized in the background. When the > other > child closes, the start form restores. MDI children are either all > maximized, or none maximized. > > -- > Brian Schwartz > FishNet Components > http://www.fishnetcomponents.com > Building better tools for developers - Be part of it! > > > "Siv" <msnewsgroups@removeme.sivill.com> wrote in message > news:e84Xaix%23EHA.3924@TK2MSFTNGP15.phx.gbl... >> Nak, >> It looks to me like the resize event code was to blame. I have removed > that >> and put the Start form back to how it was (with control box and max >> button >> but no Min button) and it works fine. >> What I still don't get is why the one form that was causing me a problem >> kept creating multiple control boxes and icons yet the others didn't do > it? >> Siv >> >> -- >> Siv >> Martley, Near Worcester, UK. >> "Nak" <a@a.com> wrote in message >> news:OthcH3w%23EHA.2700@TK2MSFTNGP14.phx.gbl... >> > Hi Siv, >> > >> > I've tried replicating your issue by making an MDI parent and 2 >> > children. In the MDI parent I have added a menu with 2 options, this >> > is >> > the code that I have put in the form, >> > >> > Private Function showForm(ByVal iName As String) As Boolean >> > Dim frm As Form >> > For Each frm In Me.MdiChildren >> > If (frm.Name = iName) Then >> > frm.BringToFront() >> > Return (True) >> > End If >> > Next >> > End Function >> > >> > Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As >> > System.EventArgs) Handles MenuItem2.Click >> > If (Not (showForm("Form2"))) Then >> > Dim pFrmForm1 As New Form2() >> > pFrmForm1.Name = "Form2" >> > pFrmForm1.MdiParent = Me >> > Call pFrmForm1.Show() >> > End If >> > End Sub >> > >> > Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As >> > System.EventArgs) Handles MenuItem3.Click >> > If (Not (showForm("Form3"))) Then >> > Dim pFrmForm1 As New Form3() >> > pFrmForm1.Name = "Form3" >> > pFrmForm1.MdiParent = Me >> > Call pFrmForm1.Show() >> > End If >> > End Sub >> > >> > When either menu item is clicked the form is either created (if >> > showform returns false) or brought to the front. No problems have > occured >> > which make me think that you might have some code elsewhere causing the >> > issue, are you putting anything into the Closing events of the >> > children? >> > I know I experienced a bug once with relation to the MDI child list in > the >> > menu but I think this one can be resolved. If you can post your code > that >> > replicates this then please do, I'll take a look at it, other than that > I >> > think you need to check your code. >> > >> > Nick. >> > >> > "Siv" <msnewsgroups@removeme.sivill.com> wrote in message >> > news:eViyhow%23EHA.1084@tk2msftngp13.phx.gbl... >> > Hi, >> > I have an MDI application that uses a generic "ShowPage" routine in a >> > module that is called when I want to display a child form. The basic > idea >> > is that in the module I have declared each form as follows: >> > >> > Friend F0 As frmMain >> > Friend F1 As frmStart >> > Friend F2 As frmSearch >> > Then in my ShowPage routine (which is passed a string "pageToShow" >> > which >> > is the name of the form I wish to open), I first check to see if we >> > already have an instance of the form open: >> > For Each frm As Form In F0.MdiChildren >> > If frm.Name = pageToShow Then >> > frm.BringToFront() >> > Exit Function >> > End If >> > Next >> > If the form isn't already open the code carries on past the above and >> > opens a new instance of the form: >> > >> > Select Case pageToShow >> > >> > Case "frmStart" >> > F1 = New frmStart >> > F1.MdiParent = F0 >> > F1.Show() >> > Case "frmSearch" >> > F2 = New frmSearch >> > F2.MdiParent = F0 >> > F2.Show() >> > F2.Activate() >> > F2.WindowState = FormWindowState.Maximized >> > Etc .. >> > I usually have a button at the bottom of each form that allows the user > to >> > close it and return to the start page (this is an MDI child form that >> > is >> > never closed whilst the app is running as it has a series of button >> > that >> > access all the other forms on it. >> > In the click event of the individual forms I have the following: >> > Me.Close() >> > F1.Activate() >> > (F1 being the Start form). >> > Now the problem. Up to now I have had no problem with this method of >> > opening and closing forms. Today I added a new form to the set and >> > configured it like all the others. The problem is that when I close > this >> > particular form and then re-open another form, its icon stays in the > menu >> > bar along with the form just being opened and at the right hand end of > the >> > menu bar I am getting multiple sets of min,max/restore,close buttons. > The >> > more time I return to the Start Menu and open forms the more of these >> > additional control boxes appear almost filling the bar. Clicking these >> > controls has no effect, or clicking the control menus at the left hand > end >> > underneath the form icons doesn't do anything. It's as if these icons > and >> > controls are now lost from their form. >> > Does anyone know why this one form could have caused this behaviour?, I >> > have checked the form and compared all its non-default properties with > the >> > ones that don't cause this behaviour and they all have the same > settings. >> > One thing I have also noticed is that when I return to the Start form, > the >> > icon is usually the icon from the last form opened not the start form's >> > own icon. >> > Siv >> > Martley, Near Worcester, UK. >> > >> >> > >
- Next message: Larry Woods: "Test for multiple application executions (VB.NET)?"
- Previous message: Larry Woods: "Re: How do I refer to Startup Form Controls from another form."
- In reply to: Brian Schwartz: "Re: Multiple MDI Child Icons and Control Boxes Why??"
- Messages sorted by: [ date ] [ thread ]