Auto adjust windows application screen size according to screen resolution

579 Views Asked by At

I'm currently making an application which contains 1 window and many similar formatted page (width = 800, height = 450).

If I don't define the minwidth and minheight then the screen looks like this(below image) and If I define minwidth and minheight(1000,650) then the screen is not fitting to all screen resolutions(In small resolution laptops the screen is cutting).

enter image description here

How can I make the window fit to screen resolution with minimum of width and height as(70%,70%)of screen resolution.

I've tried using this.sizetocontent=SizeToContent.WidthAndHeight but no use.Can anyone please help me with this.

Thank you :)

1

There are 1 best solutions below

0
On BEST ANSWER

Setting Screen size

Width =System.Windows.SystemParameters.PrimaryScreenWidth;
Height = System.Windows.SystemParameters.PrimaryScreenHeight;

setting 70% as min size

MinWidth=70* width / 100 ;
MinHeight=70* height / 100 ;