Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
There is a grid on border of wpf.I want to resize the wpf window on double click on grid. xaml code below:
XML
<Grid Name="maxMinCloseGrid" Height="50"   ClipToBounds="False"  IsHitTestVisible="True">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition  Width=".300*" />
                                    <ColumnDefinition Width=".700*" />
                                </Grid.ColumnDefinitions>
                                <Label Margin="105,5,0,1" Name="titleLabel" DockPanel.Dock="Top"
                                    Background="Transparent" ClipToBounds="False" Foreground="{DynamicResource MyDarkBlueSolidBrush}" FontFamily="Tahoma"
                                    Grid.Column="1" HorizontalAlignment="Left" Width="185" FontSize="14" FontStyle="Normal"
                                     >OMNIKEY Workbench
                                </Label>
                                <Button  Name="closeButton" Margin="0,0,2,15" Click="closeButtonClick" Width="25"  Height="20"
                                TextBlock.FontWeight="Bold" Background="Transparent" BorderBrush="Transparent" Foreground="{DynamicResource MyDarkBlueSolidBrush}"
                                    HorizontalAlignment="Right" Grid.Column="1" BorderThickness="0" FontFamily="Webdings">
                                    r
                                </Button>
                                <Button Margin="0,0,26,15" Click="maximizeButtonClick"    Grid.Column="1" BorderThickness="0"  Focusable="False"  HorizontalAlignment="Right" VerticalAlignment="Center">
                               </Button>
                                <Button Name="minimizeButton" Margin="0,0,50,15" TextBlock.FontWeight="Bold" Foreground="{DynamicResource MyDarkBlueSolidBrush}"
                       Background="Transparent" BorderBrush="Transparent" BorderThickness="0"  Width="25" Height="20" FontWeight="Bold"
                               HorizontalAlignment="Right" Click="minimizeButtonClick" Grid.Column="1" FontSize="11" Focusable="False" Content="0" FontFamily="Webdings">
                                </Button>
                            </Grid>
Posted
Comments
Programm3r 30-Sep-11 7:04am    
This might be a stupid question, but why would you want to do that?? Why can't the user double click the window title? This would create the same result....
Simon Bang Terkildsen 1-Oct-11 11:35am    
If you set WindowStyle to None then there is no title bar, you would do this if you were to create a custom designed window.
Pradeep Shukla 30-Sep-11 13:00pm    
Please do not repost...http://www.codeproject.com/Questions/262295/double-click-on-border-of-wpf

1 solution

Please see your original post ^]
 
Share this 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