ClassRadTitleBarElement
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.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[ComVisible(false)]
public class RadTitleBarElement : RadItem, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemRadTitleBarElement
Derived Classes:
Implements:
Inherited Members
Constructors
RadTitleBarElement()
Declaration
public RadTitleBarElement()
Fields
layout
Gets or sets the dock layout panel that manages the title bar's child element layout.
titleBarIcon
Gets or sets the image primitive that displays the title bar icon.
Properties
AllowResize
Determines whether the parent form can be resized by dragging the title bar's edges.
Declaration
[Browsable(true)]
public bool AllowResize { get; set; }
Property Value
BorderPrimitive
Gets the border primitive that renders the title bar's border.
Declaration
[Browsable(false)]
public BorderPrimitive BorderPrimitive { get; }
Property Value
CanManageOwnerForm
Gets or sets a value indicating whether the title bar can manage the parent form's window operations such as moving and resizing.
CaptionElement
Gets the element that displays the title bar caption text.
CloseButton
Gets the close button element that allows users to close the parent form.
Declaration
public RadButtonElement CloseButton { get; }
Property Value
FillPrimitive
Gets the fill primitive element of the title bar.
Declaration
[Browsable(false)]
public FillPrimitive FillPrimitive { get; }
Property Value
HelpButton
Gets the help button element that allows users to access context-sensitive help.
Declaration
public RadButtonElement HelpButton { get; }
Property Value
IconPrimitive
Gets or sets the image primitive that displays the title bar icon.
Declaration
public ImagePrimitive IconPrimitive { get; set; }
Property Value
ImageIcon
Gets or sets the icon displayed in the title bar and associated with the parent form.
LeftImage
Gets or sets the left image displayed in the title bar.
MaximizeButton
Gets the maximize/restore button element that allows users to maximize or restore the parent form.
Declaration
public RadButtonElement MaximizeButton { get; }
Property Value
MiddleImage
Gets or sets the middle image displayed in the title bar.
MinimizeButton
Gets the minimize button element that allows users to minimize the parent form.
Declaration
public RadButtonElement MinimizeButton { get; }
Property Value
RightImage
Gets or sets the right image displayed in the title bar.
SystemButtons
Gets the stack layout element that contains all system buttons (minimize, maximize, close, help).
Declaration
[Browsable(false)]
public StackLayoutElement SystemButtons { get; }
Property Value
TitleBarFill
Gets the fill primitive that renders the title bar's background fill.
Declaration
[Browsable(false)]
public FillPrimitive TitleBarFill { get; }
Property Value
TitlePrimitive
Gets or sets the text primitive that displays the title bar caption text.
Declaration
public TextPrimitive TitlePrimitive { get; set; }
Property Value
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
e
A 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
e
A MouseEventArgs that contains the event data.
form
The parent 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.
OnDoubleClick(EventArgs)
Raises the DoubleClick event and handles the double-click functionality for maximizing/restoring the form.
OnHelpButtonClick(object, EventArgs)
Handles the help button click event and triggers the help functionality.
OnMaximizeRestore(object, EventArgs)
Handles the maximize/restore button click event and raises the MaximizeRestore event.
OnMinimize(object, EventArgs)
Handles the minimize button click event and raises the Minimize event.
OnMouseDown(MouseEventArgs)
Raises the MouseDown event and handles mouse down operations for form manipulation.
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
e
A 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
e
A 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
e
A 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
e
A 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
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
e
A RadPropertyChangedEventArgs that contains the event data.
Overrides
PaintOverride(IGraphics, Rectangle, float, SizeF, bool)
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
screenRadGraphics
The graphics object used for rendering.
clipRectangle
The rectangle that defines the clipping region.
angle
The rotation angle for the rendering.
scale
The scale factor for the rendering.
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 Value
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 Value
Minimize
Occurs when a minimize action is performed by the user through the minimize button.
Declaration
public event TitleBarSystemEventHandler Minimize
Event Value