Click here to Skip to main content
15,887,930 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to change the thickness of the borders of a form when it is displayed. My app I written in VB using VS2013. Any ideas?
Posted

1 solution

First, you can choose one from the available borders: https://msdn.microsoft.com/en-us/library/system.windows.forms.form.formborderstyle%28v=vs.110%29.aspx[^].

If this is not enough, you can use borderless form and draw a border in the client area using overridden OnPaint method. To avoid intersection with the form's content, add some Padding. But if you want to do it in more accurate and universal way (say, if you develop a universal base class for other form classes), you can use adjust the client size by overriding Control.SetClientSizeCore, to make some extra room for your border:
https://msdn.microsoft.com/en-us/library/system.windows.forms.control.setclientsizecore%28v=vs.110%29.aspx[^].

—SA
 
Share this answer
 
Comments
Ralf Meier 22-May-15 0:38am    
+5It was not my Question but the Information with the SetClientSizeCore was for me very useful too.
Sergey Alexandrovich Kryukov 22-May-15 1:15am    
Thank you, Ralf.
—SA
Slow Eddie 26-May-15 14:39pm    
Thanks for the quick reply. I will try the control.SetClientSizeCore. However this is the form scroll bar itself. I am not sure if I can set the padding. I had already tried your other suggestion, however we need the forms to be sizeable.

Ed

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