Control sizing and position will change when form will resize in win form application c#
suppose i have label and button on textbox and i want that if i resize my win form then my label and button size and position will change. i got the solution in wpf but i am working with win form apps. here i am giving the url from where you can see what kind of output i am looking form. the url is http://i.stack.开发者_如何学Goimgur.com/QeoVK.png. please see the image and tell me how can i implement the same output in win form apps. please help me with code snippet in c#.thanks.
You should make yourself familiar with the Anchor
and Dock
properties of the controls. They are great tools for this kind of work.
Note though that they will alter the size of the controls only, they will not affect font size.
consider that window forms and WPF are very different, especially about the UI management and controls nesting / UI composition.
I have seen some articles describing what you are trying to do now in windows forms, long ego, it's something called control scaling if I recall well.
Use Anchor and Dock properties for simple stuff and SizeChanged event for more complicated stuff. UI positioning API is much more limited than WPF and you will probably have to do stuff like scaling manually.
精彩评论