Class ShapedForm
Represents a form with customizable shape and appearance that can be themed.
Inheritance
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class ShapedForm : Form, IThemeChangeListener
  Constructors
ShapedForm()
Initializes a new instance of the ShapedForm class.
Declaration
public ShapedForm()
  Properties
AllowResize
Allow form's resize
Declaration
public bool AllowResize { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
BackColor
Gets or sets the BackColor of the ShapedForm.
Declaration
public override Color BackColor { get; set; }
  Property Value
| 
        System.Drawing.Color
         
  | 
    
BorderAlignment
Gets or sets the pen alignment for the border.
Declaration
public PenAlignment BorderAlignment { get; set; }
  Property Value
| 
        System.Drawing.Drawing2D.PenAlignment
         
  | 
    
BorderColor
Gets or sets the form's border color
Declaration
public Color BorderColor { get; set; }
  Property Value
| 
        System.Drawing.Color
         
  | 
    
BorderPath
Declaration
protected GraphicsPath BorderPath { get; set; }
  Property Value
| 
        System.Drawing.Drawing2D.GraphicsPath
         
  | 
    
BorderWidth
Gets or sets the form's border width
Declaration
public virtual int BorderWidth { get; set; }
  Property Value
| 
        System.Int32
         
  | 
    
ControlThemeClassName
Gets or sets the theme class name for the control.
Declaration
public string ControlThemeClassName { get; }
  Property Value
| 
        System.String
         
  | 
    
Implements
CreateParams
Declaration
protected override CreateParams CreateParams { get; }
  Property Value
| 
        System.Windows.Forms.CreateParams
         
  | 
    
EnableCompositionOnVista
Enables or disables transparent background on Vista
Declaration
public bool EnableCompositionOnVista { get; set; }
  Property Value
| 
        System.Boolean
         
  | 
    
Font
Gets or sets the form's font
Declaration
public override Font Font { get; set; }
  Property Value
| 
        System.Drawing.Font
         
  | 
    
ForeColor
Gets or sets the form's foreground color
Declaration
public override Color ForeColor { get; set; }
  Property Value
| 
        System.Drawing.Color
         
  | 
    
FormBorderStyle
Gets or sets the FormBorderStyle of the Form.
Declaration
public FormBorderStyle FormBorderStyle { get; set; }
  Property Value
| 
        System.Windows.Forms.FormBorderStyle
         
  | 
    
OuterPath
Declaration
protected GraphicsPath OuterPath { get; set; }
  Property Value
| 
        System.Drawing.Drawing2D.GraphicsPath
         
  | 
    
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
public virtual ElementShape Shape { get; set; }
  Property Value
| 
        ElementShape
         
  | 
    
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 System.Drawing.Design.UITypeEditor.
ShapedControl
ThemeName
Gets or sets theme name.
Declaration
public string ThemeName { get; set; }
  Property Value
| 
        System.String
         
  | 
    
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
| 
        WindowsSettings
         
  | 
    
Methods
ApplicationThemeChanged(Object, ThemeChangedEventArgs)
Declaration
protected virtual void ApplicationThemeChanged(object sender, ThemeChangedEventArgs args)
  Parameters
| 
        System.Object
        sender
         
  | 
    
| 
        ThemeChangedEventArgs
        args
         
  | 
    
ApplyShape()
Declaration
protected virtual void ApplyShape()
  ApplyTheme(String)
Declaration
protected virtual void ApplyTheme(string themeName)
  Parameters
| 
        System.String
        themeName
         
  | 
    
CreateBorderPath()
Declaration
protected virtual GraphicsPath CreateBorderPath()
  Returns
| 
        System.Drawing.Drawing2D.GraphicsPath
         
  | 
    
Dispose(Boolean)
Clean up any resources being used.
Declaration
protected override void Dispose(bool disposing)
  Parameters
| 
        System.Boolean
        disposing
         true if managed resources should be disposed; otherwise, false.  | 
    
GetHitTest(Point)
Declaration
protected virtual int GetHitTest(Point point)
  Parameters
| 
        System.Drawing.Point
        point
         
  | 
    
Returns
| 
        System.Int32
         
  | 
    
IsRectangularShape(ref Int32)
Declaration
protected virtual bool IsRectangularShape(ref int radius)
  Parameters
| 
        System.Int32
        radius
         
  | 
    
Returns
| 
        System.Boolean
         
  | 
    
LOWORD(Int32)
Declaration
public static short LOWORD(int number)
  Parameters
| 
        System.Int32
        number
         
  | 
    
Returns
| 
        System.Int16
         
  | 
    
OnLoad(EventArgs)
Declaration
protected override void OnLoad(EventArgs e)
  Parameters
| 
        System.EventArgs
        e
         
  | 
    
OnMove(EventArgs)
Declaration
protected override void OnMove(EventArgs e)
  Parameters
| 
        System.EventArgs
        e
         
  | 
    
OnPaintBackground(PaintEventArgs)
Declaration
protected override void OnPaintBackground(PaintEventArgs e)
  Parameters
| 
        System.Windows.Forms.PaintEventArgs
        e
         
  | 
    
OnResizeBegin(EventArgs)
Declaration
protected override void OnResizeBegin(EventArgs e)
  Parameters
| 
        System.EventArgs
        e
         
  | 
    
OnResizeEnd(EventArgs)
Declaration
protected override void OnResizeEnd(EventArgs e)
  Parameters
| 
        System.EventArgs
        e
         
  | 
    
OnShown(EventArgs)
Declaration
protected override void OnShown(EventArgs e)
  Parameters
| 
        System.EventArgs
        e
         
  | 
    
OnSizeChanged(EventArgs)
Declaration
protected override void OnSizeChanged(EventArgs e)
  Parameters
| 
        System.EventArgs
        e
         
  | 
    
OnThemeChanged(ThemeChangedEventArgs)
Handles theme change events to update the form's appearance.
Declaration
public void OnThemeChanged(ThemeChangedEventArgs e)
  Parameters
| 
        ThemeChangedEventArgs
        e
         The theme changed event arguments.  | 
    
Implements
PaintBorder(Graphics)
Declaration
protected virtual void PaintBorder(Graphics g)
  Parameters
| 
        System.Drawing.Graphics
        g
         
  | 
    
PaintFrame(Graphics)
Declaration
protected virtual void PaintFrame(Graphics g)
  Parameters
| 
        System.Drawing.Graphics
        g
         
  | 
    
ScaleControl(SizeF, BoundsSpecified)
Declaration
protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
  Parameters
| 
        System.Drawing.SizeF
        factor
         
  | 
    
| 
        System.Windows.Forms.BoundsSpecified
        specified
         
  | 
    
SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified)
Declaration
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
  Parameters
| 
        System.Int32
        x
         
  | 
    
| 
        System.Int32
        y
         
  | 
    
| 
        System.Int32
        width
         
  | 
    
| 
        System.Int32
        height
         
  | 
    
| 
        System.Windows.Forms.BoundsSpecified
        specified
         
  | 
    
SetClientSizeCore(Int32, Int32)
Declaration
protected override void SetClientSizeCore(int x, int y)
  Parameters
| 
        System.Int32
        x
         
  | 
    
| 
        System.Int32
        y
         
  | 
    
WndProc(ref Message)
Declaration
protected override void WndProc(ref Message m)
  Parameters
| 
        System.Windows.Forms.Message
        m
         
  |