Showing MdiChild Form in widows menu when showing it in a panel in MdiForm
-
Dear All: When trying to show Mdichild Form in a panel inside Mdiform, windows menu doesn't show the opened form in its menus items and here is the code dim CURForm As New Windows.Forms.Form CURForm = New FrmPartenersFamilies CURForm.WindowState = FormWindowState.Maximized CURForm.StartPosition = FormStartPosition.Manual CURForm.MdiParent = Me CURForm.Show() CURForm.Parent = Me.SplitContainer1.Panel2 could you help me in this otherwise show me how to a add related menuitem in windows menu Thanks in advance Aiman Farouk
-
Dear All: When trying to show Mdichild Form in a panel inside Mdiform, windows menu doesn't show the opened form in its menus items and here is the code dim CURForm As New Windows.Forms.Form CURForm = New FrmPartenersFamilies CURForm.WindowState = FormWindowState.Maximized CURForm.StartPosition = FormStartPosition.Manual CURForm.MdiParent = Me CURForm.Show() CURForm.Parent = Me.SplitContainer1.Panel2 could you help me in this otherwise show me how to a add related menuitem in windows menu Thanks in advance Aiman Farouk
Aiman Farouk Mohamed wrote:
CURForm.Parent = Me.SplitContainer1.Panel2
You can't do this. The form will no longer be treated as an MdiChild. You're resetting the parent container from the MdiClient control that is implicitly created on an MdiParent form and moving it to a control that knows nothing of MDI.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Dear All: When trying to show Mdichild Form in a panel inside Mdiform, windows menu doesn't show the opened form in its menus items and here is the code dim CURForm As New Windows.Forms.Form CURForm = New FrmPartenersFamilies CURForm.WindowState = FormWindowState.Maximized CURForm.StartPosition = FormStartPosition.Manual CURForm.MdiParent = Me CURForm.Show() CURForm.Parent = Me.SplitContainer1.Panel2 could you help me in this otherwise show me how to a add related menuitem in windows menu Thanks in advance Aiman Farouk
You could show that "Form" in the windows menu by programatically adding it to the menu via something like...
WindowsMenu.DropDownItems.Add("Whatever")
I am not sure you can get it to show up as part of your MdiWindowList but you can try with something like...
MenuStrip.MdiWindowListItem.DropDownItems.Add("Whatever")
In both cases you would have to handle the DropDownItemClicked event for that menu item programatically to set focus to the "Form" if that menu item was clicked. You would also want to delete the menu item programatically when the "Form" was closed.