I have noticed that some applications change their controls position to adjust them as much as possible in the resolution as possible, If window is maximized they set themselves in such a way that over all GUI looks balanced. My question is that is it possible to make or implement this functionality in Visual studio 2010 C#?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Here I like to use https://www.netresize.net/index.php?c=3a&id=11#buyopt. But it is paid version.
You also can get their source codes if you buy 1 Site License (Unlimited Developers).
How ever I am finding the nuget package solution.
Use combinations of these to get the desired result:
Set
Anchor
property to None, the controls will not be resized, they only shift their position.Set
Anchor
property to Top+Bottom+Left+Right, the controls will be resized but they don't change their position.Set the
Minimum Size
of the form to a proper value.Set
Dock
property.Use
Form Resize
event to change whatever you wantI don't know how font size (label, textbox, combobox, etc.) will be affected in (1) - (4), but it can be controlled in (5).
..and to detect a change in resolution to handle it (once you're using Docking and Anchoring like SwDevMan81 suggested) use the SystemEvents.DisplaySettingsChanged event in Microsoft.Win32.
add this code at page load do for all control or add all control in containers