473,729 Members | 2,149 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple MDI Child Icons and Control Boxes Why??

Siv
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.BringToFron t()
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.

Nov 21 '05 #1
7 3112
Nak
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.BringToFron t()
Return (True)
End If
Next
End Function

Private Sub MenuItem2_Click (ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MenuItem2.Click
If (Not (showForm("Form 2"))) Then
Dim pFrmForm1 As New Form2()
pFrmForm1.Name = "Form2"
pFrmForm1.MdiPa rent = Me
Call pFrmForm1.Show( )
End If
End Sub

Private Sub MenuItem3_Click (ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MenuItem3.Click
If (Not (showForm("Form 3"))) Then
Dim pFrmForm1 As New Form3()
pFrmForm1.Name = "Form3"
pFrmForm1.MdiPa rent = 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" <ms**********@r emoveme.sivill. com> wrote in message
news:eV******** ********@tk2msf tngp13.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.BringToFron t()
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.
Nov 21 '05 #2
Siv
Nak,

I only do the me.close and f1.activate calls. the forms don't do anything
else as far as I can remember. I'll have a hunt through the forms own
events and see if I can see anything being done and report back.

Whilst waiting for a reply to my plea for help, I tried changing the Start
Form so that it doesn't have a control box, min or max buttons.

In this instance when it opens it does initially have a control box though
its close button is disabled. When I click one of its buttons to call up
another form and then close that and come back, the Start form now doesn't
display a control box or a sytem menu and icon and in fact my problem with
the new form goes away, I can call it up and exit it and I don't get the
multiple Icons and control boxes appearing on oipening the same form or any
of the others.

It feels to me like there is a corruption in the problem form or the start
form in relation to its system menu.

One thing that might be relevant, I had put a bit of code in the resize
event of the start form that stops the user resizing it:

Private Sub frmStart_Resize (ByVal sender As Object, ByVal e As
System.EventArg s) Handles MyBase.Resize
Me.WindowState = FormWindowState .Maximized
End Sub

Basically I was trying to stop the user from restoring or minimising the
start form and thus thinking they had no way to navigate around the app
(there are menus on the main MDI parent that will allow them to select all
the pages but some users just panic if there are no buttons on screen).
Could it be that as the MDI parent switches between the selected form and
the start form a resize occurs and this triggers some sort of cascade in the
frmStart_Resize event?? that interferes with the display of the child form's
icon and control boxes??

Siv,
Martley, Near Worcester. UK


"Nak" <a@a.com> wrote in message
news:Ot******** ********@TK2MSF TNGP14.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.BringToFron t()
Return (True)
End If
Next
End Function

Private Sub MenuItem2_Click (ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MenuItem2.Click
If (Not (showForm("Form 2"))) Then
Dim pFrmForm1 As New Form2()
pFrmForm1.Name = "Form2"
pFrmForm1.MdiPa rent = Me
Call pFrmForm1.Show( )
End If
End Sub

Private Sub MenuItem3_Click (ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MenuItem3.Click
If (Not (showForm("Form 3"))) Then
Dim pFrmForm1 As New Form3()
pFrmForm1.Name = "Form3"
pFrmForm1.MdiPa rent = 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" <ms**********@r emoveme.sivill. com> wrote in message
news:eV******** ********@tk2msf tngp13.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.BringToFron t()
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.

Nov 21 '05 #3
Siv
Nak,
I checked, all the other forms don't do anything in any of their closing
events.

--
Siv
Martley, Near Worcester, UK.
"Nak" <a@a.com> wrote in message
news:Ot******** ********@TK2MSF TNGP14.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.BringToFron t()
Return (True)
End If
Next
End Function

Private Sub MenuItem2_Click (ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MenuItem2.Click
If (Not (showForm("Form 2"))) Then
Dim pFrmForm1 As New Form2()
pFrmForm1.Name = "Form2"
pFrmForm1.MdiPa rent = Me
Call pFrmForm1.Show( )
End If
End Sub

Private Sub MenuItem3_Click (ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MenuItem3.Click
If (Not (showForm("Form 3"))) Then
Dim pFrmForm1 As New Form3()
pFrmForm1.Name = "Form3"
pFrmForm1.MdiPa rent = 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" <ms**********@r emoveme.sivill. com> wrote in message
news:eV******** ********@tk2msf tngp13.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.BringToFron t()
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.

Nov 21 '05 #4
Siv
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:Ot******** ********@TK2MSF TNGP14.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.BringToFron t()
Return (True)
End If
Next
End Function

Private Sub MenuItem2_Click (ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MenuItem2.Click
If (Not (showForm("Form 2"))) Then
Dim pFrmForm1 As New Form2()
pFrmForm1.Name = "Form2"
pFrmForm1.MdiPa rent = Me
Call pFrmForm1.Show( )
End If
End Sub

Private Sub MenuItem3_Click (ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MenuItem3.Click
If (Not (showForm("Form 3"))) Then
Dim pFrmForm1 As New Form3()
pFrmForm1.Name = "Form3"
pFrmForm1.MdiPa rent = 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" <ms**********@r emoveme.sivill. com> wrote in message
news:eV******** ********@tk2msf tngp13.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.BringToFron t()
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.

Nov 21 '05 #5
Nak
Hi there,

Sorry for the lengthy delay in my reply, I got a bit side tracked.
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.
Aaah, well at least you have found the problem :-)
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


That's the wonders of programming I suppose, or sods law, what seems
comletely and utterly ilogical at the time turns out to make perfect sence
if you go into it deep enough. I don't know the real reason why it was
doing as you said but I have experienced some strange issues in relation to
mdi child lists in the menu going a bit loopy and leaving icons lying
around. I ended up rolling my own mdi child list in the end just to get a
working solution. At least you didn't have to go to that extreme.

You might want to take a look at adding borderless forms to a container
if you want total control over the child forms. Just remember that you need
to set the hidden property "toplevel" to false before it can be added.
Anyways, good to hear it's sorted :-)

Nick.
Nov 21 '05 #6
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" <ms**********@r emoveme.sivill. com> wrote in message
news:e8******** ********@TK2MSF TNGP15.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:Ot******** ********@TK2MSF TNGP14.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.BringToFron t()
Return (True)
End If
Next
End Function

Private Sub MenuItem2_Click (ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MenuItem2.Click
If (Not (showForm("Form 2"))) Then
Dim pFrmForm1 As New Form2()
pFrmForm1.Name = "Form2"
pFrmForm1.MdiPa rent = Me
Call pFrmForm1.Show( )
End If
End Sub

Private Sub MenuItem3_Click (ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MenuItem3.Click
If (Not (showForm("Form 3"))) Then
Dim pFrmForm1 As New Form3()
pFrmForm1.Name = "Form3"
pFrmForm1.MdiPa rent = 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" <ms**********@r emoveme.sivill. com> wrote in message
news:eV******** ********@tk2msf tngp13.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.BringToFron t()
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.


Nov 21 '05 #7
Siv
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" <br***@fishnetc omponentswos.co m> wrote in message
news:eM******** ********@tk2msf tngp13.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" <ms**********@r emoveme.sivill. com> wrote in message
news:e8******** ********@TK2MSF TNGP15.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:Ot******** ********@TK2MSF TNGP14.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.BringToFron t()
> Return (True)
> End If
> Next
> End Function
>
> Private Sub MenuItem2_Click (ByVal sender As System.Object, ByVal e As
> System.EventArg s) Handles MenuItem2.Click
> If (Not (showForm("Form 2"))) Then
> Dim pFrmForm1 As New Form2()
> pFrmForm1.Name = "Form2"
> pFrmForm1.MdiPa rent = Me
> Call pFrmForm1.Show( )
> End If
> End Sub
>
> Private Sub MenuItem3_Click (ByVal sender As System.Object, ByVal e As
> System.EventArg s) Handles MenuItem3.Click
> If (Not (showForm("Form 3"))) Then
> Dim pFrmForm1 As New Form3()
> pFrmForm1.Name = "Form3"
> pFrmForm1.MdiPa rent = 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" <ms**********@r emoveme.sivill. com> wrote in message
> news:eV******** ********@tk2msf tngp13.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.BringToFron t()
> 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.
>



Nov 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3846
by: Diana Gard | last post by:
Perhaps this is a design flaw, please let me know. I'm using Access 2000. I have a form with a tab control and 5 subforms within those tabs. The forms match with the tables: Client main, Intake, Financial, Fees, Payments, Bills, Bill Line Items. The design works thusly - Client Main relates to Intake. Intake relates to financial. Financial relates Fees, Payments and Bills. Bills relates to Bill Line Items. On the form, I use the...
6
1396
by: Shimon Sim | last post by:
Is there a consistent way to find out the id of child controls of the UserControl. Should I just use this.name+"_+control.Id;? Shimon
3
2788
by: Nathan Sokalski | last post by:
When I view any page in my application a second time, I recieve the following error: System.Web.TraceContext.AddNewControl(String id, String parentId, String type, Int32 viewStateSize) +313 System.Web.UI.Control.BuildProfileTree(String parentId, Boolean calcViewState) +201 System.Web.UI.Control.BuildProfileTree(String parentId, Boolean calcViewState) +263
1
6231
by: R2D2 | last post by:
Hello, I am trying to get a form to draw arrows linking 2 list boxes to each other. I can write the code to draw the arrows / make them follow the boxes around when they are dragged around the form, however, the form always draws the arrow under the child controls. I was wondering if anyone could tell me how I would make the arrows draw over the list boxes, instead of pass under them? The only idea I had was to call base.onPaint...
2
3443
by: SharpCoderMP | last post by:
i'm trying to embed multiple program icons in my executable. the only way so far i managed to do that is to embed native win32 resource file with multiple icons. it works, but... when i create a native win32 resource file with the VS 2005 and put there my icons, VS always converts some of the 32bit icons into 24bit - so i loose alpha blending what makes my icons look ugly. I did an experiment and created a icon file with full range of...
4
2463
by: Dave White | last post by:
Hello Everyone, I have created two tables to track my students' lessons. Each student is responsible for most, but not all. of the lessons. I've tried a junction table but I can't figure out an easy way to assign one or multiple lessons to a student. tbl_Students
1
1735
by: Seth Petry-Johnson | last post by:
Is there a way to compile a user control into a redistributable assembly , but still have access to its child controls using the .Controls property? Here's what I mean: I have a user control that contains some child controls, mostly custom text boxes and such. If I load this control declaratively or using LoadControl(), I can access those child controls using the .Controls property.
12
6233
by: Phil | last post by:
I can check for MdiChildren.Length=0, but which event handler should I put this in to detect when a child window is closed? TIA Phil.
1
2220
by: Vivienne | last post by:
Hi there This is a hard problem that I have - I have only been using sql for a couple of weeks and have gone past my ability level quickly! The real tables are complex but I will post a simple and a real version with the hope someone can help me. Any help would be much appreciated - I would also be happy to pay someone to actually do it if it takes time to work out as I know that its hard when all your help is free :)...
0
8761
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9142
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2162
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.