I have a main MDI form with the following method that is used to launch a child form.
Private Sub LaunchForm(ByVal FormType As System.Type, Optional ByVal AllowMultiple As Boolean = True) '-- Look to see if the form is already loaded - bring to front If AllowMultiple = False Then For Each loCurForm As Form In Me.MdiChildren If Not loCurForm.InvokeRequired Then ' Can access the form directly If loCurForm.GetType() Is FormType Then If loCurForm.WindowState = FormWindowState.Minimized Then loCurForm.WindowState = FormWindowState.Maximized End If
loCurForm.BringToFront() Exit Sub End If End If Next End If
'-- Establish Locals Me.Cursor = Cursors.WaitCursor
Dim loForm As Form loForm = CType(Activator.CreateInstance(FormType), Form)
'-- Set the MDI loForm.MdiParent = Me
'-- Show the form loForm.Show()
Me.Cursor = Cursors.Default End Sub
The child form has a control which needs to open a new child form in the main MDI form. Any ideas about how to accomplish this?
Thanks for looking!
If you are using an MDIClient control and manually adding it to the form, then you can just expose it through a public property and basically do the same thing:
A couple of questions.... I am using a picture that you used earlier in the post... how did you create that MDI with that control panel on the left?
am i correct in assuming that if the user were to click or double click on the name of a form in the list in the control panel it would show that form?
and second, using the code you provided earlier in this post... how would I create navigation buttons to utilize this code... lets say that I wanted navigation buttons in the MDI to be able to navigate through all the child forms... yknow the basics... first, previous, next, last.
This is a really cool concept! I'm eager to implement it.
This entire explanation would be more of a tutorial rather than a quick post here...and in fact, this is one of the very things that we cover during class. I know you guys haven't had a chance to make it to class in the past, but if it were at all possible, I think that you guys would gain a lot of first hand experience on items just like this if you were able to make it to the next class
Your main form looks really good. I too was first thinking of a toolstrip dropdown that would show the open windows. Now i have decided to use a panel like yours and the one from Practice Studio, so i can use it to show some more info. I do however have issues with this (read - it doesn't look the way i want it)
Can you describe how you did your panel and lists?
TIA.
/Teddy
Public Sub New() _MdiClient.BackColor = Color.White Me.Controls.Add(_MdiClient)End Sub
Thanks - i got it now. My problem was that i set the text of an employee form to the name of the employee after it is loaded from a browsedialog. So i wanted the new text of the form to be renamed/refreshed in the list.
The rest was just cosmetic customations of the properties.
I'm glad Trent could help you, he got all this from me... oh, wait, I think the orther of the words are not set properly...