-
MDI question <Resolved>
In my aplication, I hhave a central from called a Hub, just a name.
At the moment it uses showdialog to call other forms.
On this main form I have several buttons for quick and easy non-menu access.
I have been thinking of converting this to an MDI style applicaton but have hit a problem.
When I change the main for to an MDI container and create instances of the forms as chidl forms the buttons on the main form, overlay the child form.
Firstly, is there a a way of preventing this?
A second approach was to take the buttons and group them in an mdi child form.
This however mean that I would need to create a child form from within a child form.
Is this possible? and if so does anyone know how as every examplpe I have found, show the parent being set as the current form. In other words, it always assumes that the MDI container, has nothing on it except a menu structure.
-
Hi,
You could put all the buttons in a groupbox and when any button is clicked make groupbox.Visible = False, making it visible again when necessary.
-
Okay, seem to ave found a solution to it.
Am moving all he buttons into their own MDI child form (I aslo ha a front screen search dacility then created a class1 with a public shared member
Public Class1
Public shared Hub as form
end class
In the load event of the main hub screen:
Private Sub Hub_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Class1.Hub = Me
End Sub
then when I want to create a child form from within the child form. simply say :
Dim NewMDIChild As New Form1
'Set the Parent Form of the Child window.
NewMDIChild.MdiParent = Class1.Hub
'Display the new form.
NewMDIChild.Show()
seems to work fine