Class RadTitleBarElement
Represents the main element that implements the title bar functionality. The RadTitleBar class serves as a simple wrapper for this element. All UI logic and functionality for title bar operations are implemented within this class. Use this element's events to substitute the system title bar in borderless applications.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
[ComVisible(false)]
public class RadTitleBarElement : RadItem, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IComponent, IDisposable, IBindableComponent, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode
Constructors
RadTitleBarElement()
Declaration
public RadTitleBarElement()
Fields
layout
Gets or sets the dock layout panel that manages the title bar's child element layout.
Declaration
protected DockLayoutPanel layout
Field Value
|
DockLayoutPanel
|
titleBarIcon
Gets or sets the image primitive that displays the title bar icon.
Declaration
protected ImagePrimitive titleBarIcon
Field Value
|
ImagePrimitive
|
Properties
AllowResize
Determines whether the parent form can be resized by dragging the title bar's edges.
Declaration
public bool AllowResize { get; set; }
Property Value
|
System.Boolean
|
BorderPrimitive
Gets the border primitive that renders the title bar's border.
Declaration
public BorderPrimitive BorderPrimitive { get; }
Property Value
|
BorderPrimitive
|
CanManageOwnerForm
Gets or sets a value indicating whether the title bar can manage the parent form's window operations such as moving and resizing.
Declaration
public bool CanManageOwnerForm { get; set; }
Property Value
|
System.Boolean
|
CaptionElement
Gets the element that displays the title bar caption text.
Declaration
public RadElement CaptionElement { get; }
Property Value
|
RadElement
|
CloseButton
Gets the close button element that allows users to close the parent form.
Declaration
public RadButtonElement CloseButton { get; }
Property Value
|
RadButtonElement
|
FillPrimitive
Gets the fill primitive element of the title bar.
Declaration
public FillPrimitive FillPrimitive { get; }
Property Value
|
FillPrimitive
|
HelpButton
Gets the help button element that allows users to access context-sensitive help.
Declaration
public RadButtonElement HelpButton { get; }
Property Value
|
RadButtonElement
|
IconPrimitive
Gets or sets the image primitive that displays the title bar icon.
Declaration
public ImagePrimitive IconPrimitive { get; set; }
Property Value
|
ImagePrimitive
|
ImageIcon
Gets or sets the icon displayed in the title bar and associated with the parent form.
Declaration
public Icon ImageIcon { get; set; }
Property Value
|
System.Drawing.Icon
|
LeftImage
Gets or sets the left image displayed in the title bar.
Declaration
public virtual Image LeftImage { get; set; }
Property Value
|
System.Drawing.Image
|
MaximizeButton
Gets the maximize/restore button element that allows users to maximize or restore the parent form.
Declaration
public RadButtonElement MaximizeButton { get; }
Property Value
|
RadButtonElement
|
MiddleImage
Gets or sets the middle image displayed in the title bar.
Declaration
public virtual Image MiddleImage { get; set; }
Property Value
|
System.Drawing.Image
|
MinimizeButton
Gets the minimize button element that allows users to minimize the parent form.
Declaration
public RadButtonElement MinimizeButton { get; }
Property Value
|
RadButtonElement
|
RightImage
Gets or sets the right image displayed in the title bar.
Declaration
public virtual Image RightImage { get; set; }
Property Value
|
System.Drawing.Image
|
SystemButtons
Gets the stack layout element that contains all system buttons (minimize, maximize, close, help).
Declaration
public StackLayoutElement SystemButtons { get; }
Property Value
|
StackLayoutElement
|
TitleBarFill
Gets the fill primitive that renders the title bar's background fill.
Declaration
public FillPrimitive TitleBarFill { get; }
Property Value
|
FillPrimitive
|
TitlePrimitive
Gets or sets the text primitive that displays the title bar caption text.
Declaration
public TextPrimitive TitlePrimitive { get; set; }
Property Value
|
TextPrimitive
|
Methods
CreateChildElements()
Creates and initializes all child elements of the title bar including buttons, layout panels, and primitives.
Declaration
protected override void CreateChildElements()
Overrides
HandleDoubleClickClick()
Handles the double-click action on the title bar by toggling the parent form's maximized state if allowed.
Declaration
public virtual void HandleDoubleClickClick()
HandleMouseDown(MouseEventArgs)
Handles the mouse down action by storing the initial mouse position for drag operations.
Declaration
public virtual void HandleMouseDown(MouseEventArgs e)
Parameters
|
System.Windows.Forms.MouseEventArgs
e
A System.Windows.Forms.MouseEventArgs that contains the event data. |
HandleMouseMove(MouseEventArgs, Form)
Handles mouse movement operations including form dragging and edge-based resizing with appropriate cursor changes.
Declaration
public virtual void HandleMouseMove(MouseEventArgs e, Form form)
Parameters
|
System.Windows.Forms.MouseEventArgs
e
A System.Windows.Forms.MouseEventArgs that contains the event data. |
|
System.Windows.Forms.Form
form
The parent System.Windows.Forms.Form to perform operations on. |
HandleMouseUp()
Handles the mouse up action by resetting the cursor to default state.
Declaration
public virtual void HandleMouseUp()
OnClose(Object, EventArgs)
Handles the close button click event and raises the Close event.
Declaration
protected void OnClose(object sender, EventArgs args)
Parameters
|
System.Object
sender
The source of the event. |
|
System.EventArgs
args
An System.EventArgs that contains the event data. |
OnDoubleClick(EventArgs)
Raises the DoubleClick event and handles the double-click functionality for maximizing/restoring the form.
Declaration
protected override void OnDoubleClick(EventArgs e)
Parameters
|
System.EventArgs
e
An System.EventArgs that contains the event data. |
Overrides
OnHelpButtonClick(Object, EventArgs)
Handles the help button click event and triggers the help functionality.
Declaration
protected void OnHelpButtonClick(object sender, EventArgs args)
Parameters
|
System.Object
sender
The source of the event. |
|
System.EventArgs
args
An System.EventArgs that contains the event data. |
OnMaximizeRestore(Object, EventArgs)
Handles the maximize/restore button click event and raises the MaximizeRestore event.
Declaration
protected void OnMaximizeRestore(object sender, EventArgs args)
Parameters
|
System.Object
sender
The source of the event. |
|
System.EventArgs
args
An System.EventArgs that contains the event data. |
OnMinimize(Object, EventArgs)
Handles the minimize button click event and raises the Minimize event.
Declaration
protected void OnMinimize(object sender, EventArgs args)
Parameters
|
System.Object
sender
The source of the event. |
|
System.EventArgs
args
An System.EventArgs that contains the event data. |
OnMouseDown(MouseEventArgs)
Raises the MouseDown event and handles mouse down operations for form manipulation.
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
|
System.Windows.Forms.MouseEventArgs
e
A System.Windows.Forms.MouseEventArgs that contains the event data. |
Overrides
OnMouseMove(MouseEventArgs)
Raises the MouseMove event and handles mouse movement for form resizing and dragging operations.
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
|
System.Windows.Forms.MouseEventArgs
e
A System.Windows.Forms.MouseEventArgs that contains the event data. |
Overrides
OnMouseUp(MouseEventArgs)
Raises the MouseUp event and handles mouse up operations.
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
|
System.Windows.Forms.MouseEventArgs
e
A System.Windows.Forms.MouseEventArgs that contains the event data. |
Overrides
OnNotifyPropertyChanged(PropertyChangedEventArgs)
Handles property change notifications and invalidates the element when image properties change.
Declaration
protected override void OnNotifyPropertyChanged(PropertyChangedEventArgs e)
Parameters
|
System.ComponentModel.PropertyChangedEventArgs
e
A System.ComponentModel.PropertyChangedEventArgs that contains the event data. |
Overrides
OnNotifyPropertyChanged(String)
Raises the property changed notification with the specified property name.
Declaration
protected override void OnNotifyPropertyChanged(string propertyName)
Parameters
|
System.String
propertyName
The name of the property that changed. |
Overrides
OnPropertyChanged(RadPropertyChangedEventArgs)
Raises the property changed event and handles RTL property changes.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
|
RadPropertyChangedEventArgs
e
A RadPropertyChangedEventArgs that contains the event data. |
Overrides
PaintOverride(IGraphics, Rectangle, Single, SizeF, Boolean)
Renders the title bar element with custom background images when all three images (left, right, middle) are specified.
Declaration
protected override void PaintOverride(IGraphics screenRadGraphics, Rectangle clipRectangle, float angle, SizeF scale, bool useRelativeTransformation)
Parameters
|
IGraphics
screenRadGraphics
The graphics object used for rendering. |
|
System.Drawing.Rectangle
clipRectangle
The rectangle that defines the clipping region. |
|
System.Single
angle
The rotation angle for the rendering. |
|
System.Drawing.SizeF
scale
The scale factor for the rendering. |
|
System.Boolean
useRelativeTransformation
A value indicating whether to use relative transformation. |
Overrides
Events
Close
Occurs when a close action is performed by the user through the close button or system menu. The system menu is not visible by default. Use the Visual Style Builder to configure element visibility and appearance.
Declaration
public event TitleBarSystemEventHandler Close
Event Type
|
TitleBarSystemEventHandler
|
MaximizeRestore
Occurs when a maximize or restore action is performed by the user through the maximize button or by double-clicking the title bar.
Declaration
public event TitleBarSystemEventHandler MaximizeRestore
Event Type
|
TitleBarSystemEventHandler
|
Minimize
Occurs when a minimize action is performed by the user through the minimize button.
Declaration
public event TitleBarSystemEventHandler Minimize
Event Type
|
TitleBarSystemEventHandler
|