WPF Maximize Child Window within Parent Window

Posted by Joewilliam under WPF on 6/14/2011 | Points: 10 | Views : 13637 | Status : [Member] | Replies : 9
Hi, This is Mary.

I need some clarification regarding WPF window application.
Could anyone tell me how to Maximize child window within parent window using VS 2008 and Dot net 3.5 framework.

William Mary


Responses

Posted by: Ndebata on: 6/14/2011 [Member] Starter | Points: 25

Up
0
Down
Hi
Take a look at this thread
http://social.msdn.microsoft.com/forums/en-US/wpf/thread/c4f0005b-bfc2-4e3d-84b3-cffc249567ea/

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Joewilliam on: 6/14/2011 [Member] Starter | Points: 25

Up
0
Down
It shows some bugs.

ShowWindow(new WindowInteropHelper (childWindow).Handle, SW_RESTORE);

William Mary

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Joewilliam on: 6/14/2011 [Member] Starter | Points: 25

Up
0
Down
The bug is


The type or namespace name 'WindowInteropHelper' could not be found (are you missing a using directive or an assembly reference?)

William Mary

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Joewilliam on: 6/14/2011 [Member] Starter | Points: 25

Up
0
Down
This is My Menu Control Coding

Menu.xaml

<Window x:Class="Flyking.FlykingCourierOperations"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Flyking Courier Operation Manager" Topmost="True" Height="768" Width="1020" WindowStartupLocation="CenterScreen" Background="#f7f4e9" ResizeMode="CanResize" WindowState="Maximized" >
<Grid Background="White">
<Menu Height="40" Margin="0,40,0,0" Name="menu1" VerticalAlignment="Top" Background="#434a48">
<MenuItem Header="Branch" FontSize="13" Foreground="White" Click="MenuItem_Click_4" ToolTip="Open Branch Window" />
</Menu>
</Window>

Menu.xaml.cs
private void MenuItem_Click_4(object sender, RoutedEventArgs e)
{ Branch bran = new Branch();
bran.ShowInTaskbar = false;
bran.Owner = Application.Current.MainWindow;
bran.Show();
}

My Second form name is Branch.xaml

Now the question is when i open Branch menu from menuitem(Branch.xaml window) it should be opened within that Menu.xaml window, it should maximize within that Menu.xaml window rather it should not maximize fully as equal to Menu.xaml window. How could i do that.



William Mary

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ndebata on: 6/14/2011 [Member] Starter | Points: 25

Up
0
Down
Hi

Please find the sample (your previous question) which shows how to maximize child window from parent.

Thanks,
Debata
 Download source file

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Joewilliam on: 6/14/2011 [Member] Starter | Points: 25

Up
0
Down
Its not supporting it shows Unrecognized version because i am using VS2008 with 3.5 framework

William Mary

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Joewilliam on: 6/14/2011 [Member] Starter | Points: 25

Up
0
Down
Thank u for your sample but it doest not fulfill my requirement because when i maximize the child window it goes same measurement as parent window. But my requirement it should come within that parent window even if i maximize the child window.

William Mary

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Joewilliam on: 6/14/2011 [Member] Starter | Points: 25

Up
0
Down
I need a WPF parent and child window like that which is in the attachment. Plz find the attachment sample screenshot. I did it for manually without code.
 Download source file

William Mary

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Joewilliam on: 6/14/2011 [Member] Starter | Points: 25

Up
0
Down
Child Window should maximize within Parent window without overlapping all items including taskbar and parent window.

William Mary

Joewilliam, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response