• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1041
  • Last Modified:

Disable resize

Hello all,

I program with WPF. How can I disable resize?  

myFile.xaml

<UserControl>
     <Grid>
          <TreeVeiw>
          </TreeView>
     </Grid>
</UserControl>

Thank you very much in advance. :)
0
chang2008
Asked:
chang2008
1 Solution
 
jagrut_patelCommented:
Set same value of UserControl's MinHeight and MaxHeight properties to control height and set same value of MinWidth and MaxWidth properties to control the width.

e.g.
<UserControl ..... MinHeight="100" MaxHeight="100" MinWidth="200" MaxWidth="200">
0
 
Kalpesh ChhatralaSoftware ConsultantCommented:
there is resize property set it to NoResize.

check below sample

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" ResizeMode="NoResize">
    <Grid>
       
    </Grid>
</Window>
0
 
chang2008Author Commented:
I did like this & it works.

Window window = new Window();
window.ResizeMode = ResizeMode.NoResize;

Thanks
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now