简体   繁体   中英

How to display a children form as wpf into MDI Container is normal mdi form

How to display WPF form in normal created MDI windows form.

We create form as MDI. add menu bar click menu it will display wpf form in main container MDi form.

在此输入图像描述

 private void newStudentToolStripMenuItem_Click(object sender, EventArgs e)
    {

      StudentRegister student=  new StudentRegister();
     student.ShowDialog(); 
    }

Problem is click on task bar child form go outside.

As my understanding you want to open child page inside MDI page. first of in WPF don't have MDI window.

if you are using " student.ShowDialog(); " then page or window will open as a popup.

possible solution:--

you can use ContentControl on main window and create usercontrol instead of window. then you can add user control to ContentControl.

<Border ClipToBounds="True" Grid.Row="1" Background="WhiteSmoke">
  <ContentControl x:Name="DetailsControl" Margin="10" HorizontalAlignment="Left"    VerticalAlignment="Top" />
</Border>

var student= new StudentRegister ();
DetailsControl.Content = student;

below link may help.

http://wpfmdi.codeplex.com/

http://www.codeplex.com/wikipage?ProjectName=AvalonDock

http://www.codeproject.com/Articles/22927/Multiple-Window-Interface-for-WPF

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM