Click here to Skip to main content
15,902,939 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:

HTML
<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
Updated 29-Sep-11 21:46pm
v2

1 solution

I suggest you don't do that, directly at least. Instead I suggest you use Thumb[^] instead and subscribe to the MouseDoubleClick event
 
Share this answer
 
Comments
Espen Harlinn 1-Oct-11 12:08pm    
Good idea :)
Simon Bang Terkildsen 1-Oct-11 12:29pm    
Yeah the trouble is I only get one once per day, so now I have to wait until tomorrow before I get a new one XD
Espen Harlinn 1-Oct-11 12:32pm    
Well, as most people don't get one at all - you're quite fortunate :)

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