ClassShapedForm
Represents a form with customizable shape and appearance that can be themed.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class ShapedForm : Form, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl, IThemeChangeListener
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlContainerControlFormShapedForm
Derived Classes:
Implements:
Inherited Members
Constructors
ShapedForm()
Initializes a new instance of the ShapedForm class.
Declaration
public ShapedForm()
Properties
AllowResize
Allow form's resize
Declaration
[Browsable(true)]
public bool AllowResize { get; set; }
Property Value
BackColor
Gets or sets the BackColor of the ShapedForm.
Declaration
public override Color BackColor { get; set; }
Property Value
Overrides
BorderAlignment
Gets or sets the pen alignment for the border.
Declaration
public PenAlignment BorderAlignment { get; set; }
Property Value
BorderColor
Gets or sets the form's border color
Declaration
[Browsable(true)]
public Color BorderColor { get; set; }
Property Value
BorderPath
Declaration
protected GraphicsPath BorderPath { get; set; }
Property Value
BorderWidth
Gets or sets the form's border width
Declaration
[Browsable(true)]
public virtual int BorderWidth { get; set; }
Property Value
ControlThemeClassName
Gets or sets the theme class name for the control.
Declaration
public string ControlThemeClassName { get; }
Property Value
Implements
CreateParams
Declaration
protected override CreateParams CreateParams { get; }
Property Value
Overrides
EnableCompositionOnVista
Enables or disables transparent background on Vista
Declaration
[Browsable(true)]
public bool EnableCompositionOnVista { get; set; }
Property Value
Font
Gets or sets the form's font
Declaration
[Browsable(true)]
public override Font Font { get; set; }
Property Value
Overrides
ForeColor
Gets or sets the form's foreground color
Declaration
[Browsable(true)]
public override Color ForeColor { get; set; }
Property Value
Overrides
FormBorderStyle
Gets or sets the FormBorderStyle of the Form.
Declaration
public FormBorderStyle FormBorderStyle { get; set; }
Property Value
OuterPath
Declaration
protected GraphicsPath OuterPath { get; set; }
Property Value
Shape
Gets or sets an instance of the Shape object of a form. The shape of the form is responsible for providing its' border(s) with custom shape.
Declaration
[Browsable(true)]
public virtual ElementShape Shape { get; set; }
Property Value
Remarks
Some predefined shapes are available, like RoundRectShape or EllipseShape. CustomShape offers a way to specify element's shape with a sequence of points and curves using code or the design time ElementShapeEditor UITypeEditor.
ThemeName
Gets or sets theme name.
Declaration
[Browsable(true)]
public string ThemeName { get; set; }
Property Value
WindowsSettings
Gets or sets the windows related setting. Exposes API to round the form's corners on Windows 11. Using the rounded corners API with form's shapes that are not rectangular may lead to unexpected results.
Declaration
public WindowsSettings WindowsSettings { get; set; }
Property Value
Methods
ApplicationThemeChanged(object, ThemeChangedEventArgs)
Declaration
protected virtual void ApplicationThemeChanged(object sender, ThemeChangedEventArgs args)
Parameters
sender
args
ApplyShape()
Declaration
protected virtual void ApplyShape()
ApplyTheme(string)
Declaration
protected virtual void ApplyTheme(string themeName)
Parameters
themeName
CreateBorderPath()
Declaration
protected virtual GraphicsPath CreateBorderPath()
Returns
Dispose(bool)
Clean up any resources being used.
Declaration
protected override void Dispose(bool disposing)
Parameters
disposing
true if managed resources should be disposed; otherwise, false.
Overrides
OnLoad(EventArgs)
Declaration
protected override void OnLoad(EventArgs e)
Parameters
e
Overrides
OnMove(EventArgs)
Declaration
protected override void OnMove(EventArgs e)
Parameters
e
Overrides
OnPaintBackground(PaintEventArgs)
Declaration
protected override void OnPaintBackground(PaintEventArgs e)
Parameters
e
Overrides
OnResizeBegin(EventArgs)
Declaration
protected override void OnResizeBegin(EventArgs e)
Parameters
e
Overrides
OnResizeEnd(EventArgs)
Declaration
protected override void OnResizeEnd(EventArgs e)
Parameters
e
Overrides
OnShown(EventArgs)
Declaration
protected override void OnShown(EventArgs e)
Parameters
e
Overrides
OnSizeChanged(EventArgs)
Declaration
protected override void OnSizeChanged(EventArgs e)
Parameters
e
Overrides
OnThemeChanged(ThemeChangedEventArgs)
Handles theme change events to update the form's appearance.
Declaration
public void OnThemeChanged(ThemeChangedEventArgs e)
Parameters
e
The theme changed event arguments.
Implements
ScaleControl(SizeF, BoundsSpecified)
Declaration
protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
Parameters
factor
specified
Overrides
SetBoundsCore(int, int, int, int, BoundsSpecified)
Declaration
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
Parameters
x
y
width
height
specified
Overrides
WndProc(ref Message)
Declaration
protected override void WndProc(ref Message m)
Parameters
m
Overrides