-
Nov 21st, 2018, 05:23 PM
#1
Thread Starter
Addicted Member
wpf & Screen resolution
friends
Is there any code to setup WPF window to show(Display) with any screen resolution
without Cut or become bigger than the screen
Thanks
-
Nov 21st, 2018, 10:02 PM
#2
Re: wpf & Screen resolution
Please provide a FULL and CLEAR explanation of the problem. Obviously you can set the size of a window to whatever you want so are you actually asking how to determine what the current screen resolution is in order to know what to set that size to? If you maximise a window then it will occupy the whole screen regardless of resolution, so that's an answer to the question you actually asked but may not be what you really want to know.
-
Nov 24th, 2018, 02:30 PM
#3
Thread Starter
Addicted Member
Re: wpf & Screen resolution
I want the app (window) to work with any screen resolution
maybe like (responsive)
i find this when searching
Height="{Binding SystemParameters.PrimaryScreenHeight}"
Width="{Binding SystemParameters.PrimaryScreenWidth}">
should I use this method properties when begin design the window and controls
-
Nov 28th, 2018, 01:05 AM
#4
New Member
Re: wpf & Screen resolution
WPF works at any screen resolution, there's nothing special to do about it, other than keeping in mind that the 96dpi isn't carved in stone and that the margins and heights and other values are measured in device-independent pixels. Layout works very differently in WPF than it did in WinForms. Cropping and/or bleeding you seem to be experiencing sounds like you're possibly hard-coding control positions? In general you should avoid drag-and-drop in the xaml designer, since doing that places all controls in absolute positions (if you're coming from WinForms, this pretty much means un-learning everything you know about UI design)- instead you'll want to use panels and grids, and let the framework do the layout itself. A WrapPanel seems like a good start for a "responsive" design that re-positions itself depending on the available estate.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|