Form Customization in Windows Forms Form (SfForm)
3 Sep 2020 / 2 minutes to read
Form icon
A form icon designates the picture that represents the form in the taskbar as well as the icon displayed on the title bar of the form.
Changing form icon
The form icon displayed on the title bar and task bar can be changed by using the Icon property.
this.Icon = new Icon("sfIcon.ico");
Me.Icon = New Icon("sfIcon.ico")
Form icon alignment
The form icon can be aligned vertically and horizontally by using the Style.TitleBar.IconVerticalAlignment and Style.TitleBar.IconHorizontalAlignment properties.
this.Style.TitleBar.IconVerticalAlignment = VerticalAlignment.Top;
this.Style.TitleBar.IconHorizontalAlignment = HorizontalAlignment.Right;
Me.Style.TitleBar.IconVerticalAlignment = VerticalAlignment.Top
Me.Style.TitleBar.IconHorizontalAlignment = HorizontalAlignment.Right
Form border
Appearance of the border can be customized by using the Style.Border and Style.InactiveBorder properties.
//Customize active state border appearance
this.Style.Border = new Pen(Color.SkyBlue, 2);
//Customize inactive state border appearance
this.Style.InactiveBorder = new Pen(Color.LightGray, 2);
'Customize active state border appearance
Me.Style.Border = New Pen(Color.SkyBlue, 2)
'Customize inactive state border appearance
Me.Style.InactiveBorder = New Pen(Color.LightGray, 2)
Shadow effect
Shadow effect of the form can be customized by using the Style.ShadowOpacity and Style.InactiveShadowOpacity properties.
//Customize the shadow for active state
this.Style.ShadowOpacity = 255;
//Customize the shadow for inactive state
this.Style.InactiveShadowOpacity = 100;
'Customize the shadow for active state
Me.Style.ShadowOpacity = 255
'Customize the shadow for inactive state
Me.Style.InactiveShadowOpacity = 100
NOTE
Shadow can be disabled by setting the
ShadowOpacity
property as zero.
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page