user7362545
user7362545

Reputation:

WPF Application Adjust to Any Screen

I know that if I want the screen to be maximized on any screen I can just:

this.WindowState = WindowState.Maximized;

But I have a WPF app that has 1300x500 resolution. On my full HD monitor it looks delightful. But on my notebook, not so much. I want it to have a proportional to 1300x500 size, but how do I do that? Tried out "locking" the app boundries as I was told but not working. Can I do something like get the screen resolution of the computer on which the program is running and set a default size?

Upvotes: 0

Views: 137

Answers (1)

Eric
Eric

Reputation: 1847

Try wrapping your content in a ViewBox and set the size to your target resolution. On the varying resolutions, the app will scale.

Upvotes: 2

Related Questions