Click here to Skip to main content
15,885,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Form1 has 1 panel, and inside of the Panel1 there are labels, picturebox, and textbox.

I want a program that when i change the size of the panel all controls inside of it also change their font size. like picture zoom in and zoom out.

Thanks for all comments/suggestion.
Posted
Comments
Sergey Alexandrovich Kryukov 2-Mar-12 9:25am    
Forms? Tag it.
--SA

If you are using System.Windows.Forms, use Dock = DockStile.Fill, please see:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.dock.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.dockstyle.aspx[^].

Use it with some padding through System.Windows.Forms.Control.Padding.

If you have many controls on these panel, arrange everything in some hierarchically inserted "pad" panels combining different dock style. In need some practice. This is a main way to get flexible layout of the form, to make it size/resolutions-tolerant.

See http://msdn.microsoft.com/en-us/library/system.windows.forms.control.aspx[^].

Please see my past answers on the topic:
Zom Out malfunctions when Screen resolution changes[^],
GUI Apperance - C#.Net[^],
how to dock button so that it can adjust with the form[^] (rudimentary code sample here).

—SA
 
Share this answer
 
Here's a tutorial - it's for C# but that shouldn't be a problem... Right?

http://www.switchonthecode.com/tutorials/csharp-tutorial-font-scaling[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900