Home Forums WinForms controls Other WinForms controls MDI Parent and TabbedMDI

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18531 |

    I have a MainForm that is set to IsMDIContainer. The MainForm also contains a DockLayoutManager and a TabbedMDI manager. I have created a user control and inherited from Xceed.DockingWindows.ToolWindow. The user control contains a SmartExplorerTaskPane that contains several Groups which contains Toolbat.Tool items. The state of this control is set to Docked and it docks nicely to the left side of the main form. What I am hoping to do is when I click one of the tool items in the user form that I can load a form up and put it on a tab in the main form. It says to do this I need to set the MDIParent property of the form that will be opened to the mainform.

    The problem I am having is the form is being loaded from the click event of the tool so how would I set the MDIParent to the mainform? If the click event were to call a function on the MainForm then I could use this as the MDI Parent. What is the best way to make this work. This is all done in C# Any help on understanding this would be appreciated. 

     

    Imported from legacy forums. Posted by Dewayne (had 1920 views)

    User (Old forums)
    Member
    Post count: 23064

    You should be able to retrieve the MainForm from the parent control containing the ToolWindow.  So in the click event, do something like this :

          form2.MdiParent = this.Parent.Parent as Form;

     

    Imported from legacy forums. Posted by André (had 2614 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.