What you call "resolution" is not resolution; this is simply the screen size in pixel. Resolution is very different concept, it refers to the ability of some system to resolve certain number of lines per mm/inch as separate lines; it's only in jargon use screen size is called "resolution"; we should avoid it.
The problem you described simply does not exist. You should not use manual sizes of any control. On
Forms
side, you can use
Dock
and
Padding
properties for all controls, with the
Dock
values other than
System.Windows.Forms.DockStyle.None
, it will auto-size all layout:
https://msdn.microsoft.com/en-us/library/system.windows.forms.control.dock%28v=vs.110%29.aspx[
^],
https://msdn.microsoft.com/en-us/library/system.windows.forms.dockstyle%28v=vs.110%29.aspx[
^].
On WPF side, there are many layout features where the size of the container UI element is defined by the size of content, and the size of content is defined by the size of the container. Just one example is using the value "Auto" or "*" for
ColumnWidth
or
RowHeight
in row or column definitions use for the
System.Windows.Controls.Grid
:
https://msdn.microsoft.com/en-us/library/system.windows.controls.grid%28v=vs.110%29.aspx[
^],
https://msdn.microsoft.com/en-us/library/system.windows.controls.grid.rowdefinitions%28v=vs.110%29.aspx[
^],
https://msdn.microsoft.com/en-us/library/system.windows.controls.grid.columndefinitions%28v=vs.110%29.aspx[
^].
Another example is
System.Windows.Controls.DockPanel
:
https://msdn.microsoft.com/en-us/library/system.windows.controls.dockpanel%28v=vs.110%29.aspx[
^].
You also need to understand how the
Window
sizing is defined:
https://msdn.microsoft.com/en-us/library/system.windows.window.sizetocontent%28v=vs.110%29.aspx[
^].
For mode detail on background, read on WPF Layout Model:
https://msdn.microsoft.com/en-us/library/vstudio/ms745058%28v=vs.100%29.aspx[
^],
http://www.wpftutorial.net/LayoutProperties.html[
^].
Design proper layout, and you will never face the problem you described.
—SA