Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi I have a menu bar. I also used the user control and mdicontainer.
I want to open the user control in the center of the mdicontainer by clicking on sub-menus. But i do not know
Help me please.

What I have tried:

<Grid Margin="0,63,0,0">
<mdi:MdiContainer Name="container1" Margin="0,8,0,0">
Posted
Comments
Wessel Beulink 17-Oct-17 5:36am    
Can you provide any additional information?
mahdiiiiyeh 17-Oct-17 8:12am    
I have a Main window:
<Window x:Class="Application2.MainWindow"
xmlns:mdi="clr-namespace:WPF.MDI;assembly=WPF.MDI"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Width="1300" Height="700" Loaded="Window_Loaded" >

<Grid >
<DockPanel Height="19" VerticalAlignment="Top">
<Menu Margin="0,0,0,-10" >
<MenuItem Header="File">
<MenuItem Header="New" Name="neww" Click="neww_Click" >


<Grid Margin="0,63,0,0">
<mdi:MdiContainer Name="container1" Margin="0,8,0,0">







Then I created a user control (UNewItem).
The user control appears in the top left corner of the container1.
But i want appears in center of the container1.
code behind Main window:
private void neww_Click(object sender, RoutedEventArgs e)
{
container1.Children.Add(new MdiChild()
{
Title = "",
Height = 196,
Width = 415,


Content = new UNewItem()
});
}
Richard Deeming 17-Oct-17 12:14pm    
WPF doesn't have built-in support for MDI, so you need to tell us which external library you're using.

Is it this one[^]?
mahdiiiiyeh 17-Oct-17 13:24pm    
I add reference wpf.mdi.dll
mahdiiiiyeh 19-Oct-17 3:35am    
Friends Please answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900