Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1170
Dynamically change font and spacing based on theme
posted

Hello,

I am working on a major application composed of more that a hundred controls and forms. Now we are thinking about providing multiple theme support to our application.

Now the thing is that each theme might have a different font and font size and if the font size is too large we get an issue of overlapping of controls(provided that auto size property is set).

So my question is if there is a way to automatically adjust the spaces between different control so that the form adjusts automatically to a font change? and if we can then how?? or is there another way to achieve something like this?

I want the form to retain its basic look and feel irrespective of the font used. Your suggestions are welcome and appreciated

Regards

Ishan Gandhi

Parents
No Data
Reply
  • 21795
    Offline posted

    Hello Sumit,

    Thank you for contacting Infragistics Support.

    When you change the font size of the form it is automatically resized itself together with its child controls. More information about Windows Forms automatic scaling you may find in this MSDN article http://msdn.microsoft.com/en-us/library/ms229605(v=vs.110).aspx

    Please note if you set the AutoSize property of any control to true it will, by default, resize its height in order to fit its content. My suggestion is to set AutoSize property of your controls to false.

    Please check attached sample solution where you may change the form’s font size. After each change of the font the form resize accordingly.

    Please let me know if this is what you are looking for or if I am missing something.

    CAS-148493-H7N2G0.zip
Children