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.
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
public RadTitleBarElement()
Fields
Gets or sets the dock layout panel that manages the title bar's child element layout.
protected DockLayoutPanel layout
Gets or sets the image primitive that displays the title bar icon.
protected ImagePrimitive titleBarIcon
Properties
Determines whether the parent form can be resized by dragging the title bar's edges.
[Browsable(true)]
public bool AllowResize { get; set; }
Gets the border primitive that renders the title bar's border.
[Browsable(false)]
public BorderPrimitive BorderPrimitive { get; }
Gets or sets a value indicating whether the title bar can manage the parent form's window operations such as moving and resizing.
public bool CanManageOwnerForm { get; set; }
Gets the element that displays the title bar caption text.
public RadElement CaptionElement { get; }
Gets the close button element that allows users to close the parent form.
public RadButtonElement CloseButton { get; }
Gets the fill primitive element of the title bar.
[Browsable(false)]
public FillPrimitive FillPrimitive { get; }
Gets the help button element that allows users to access context-sensitive help.
public RadButtonElement HelpButton { get; }
Gets or sets the image primitive that displays the title bar icon.
public ImagePrimitive IconPrimitive { get; set; }
Gets or sets the icon displayed in the title bar and associated with the parent form.
public Icon ImageIcon { get; set; }
Gets or sets the left image displayed in the title bar.
public virtual Image LeftImage { get; set; }
Gets the maximize/restore button element that allows users to maximize or restore the parent form.
public RadButtonElement MaximizeButton { get; }
Gets or sets the middle image displayed in the title bar.
public virtual Image MiddleImage { get; set; }
Gets the minimize button element that allows users to minimize the parent form.
public RadButtonElement MinimizeButton { get; }
Gets or sets the right image displayed in the title bar.
public virtual Image RightImage { get; set; }
Gets the stack layout element that contains all system buttons (minimize, maximize, close, help).
[Browsable(false)]
public StackLayoutElement SystemButtons { get; }
Gets the fill primitive that renders the title bar's background fill.
[Browsable(false)]
public FillPrimitive TitleBarFill { get; }
Gets or sets the text primitive that displays the title bar caption text.
public TextPrimitive TitlePrimitive { get; set; }
Methods
Creates and initializes all child elements of the title bar including buttons, layout panels, and primitives.
protected override void CreateChildElements()
Overrides:
Handles the double-click action on the title bar by toggling the parent form's maximized state if allowed.
public virtual void HandleDoubleClickClick()
Handles the mouse down action by storing the initial mouse position for drag operations.
public virtual void HandleMouseDown(MouseEventArgs e)
A MouseEventArgs that contains the event data.
Handles mouse movement operations including form dragging and edge-based resizing with appropriate cursor changes.
public virtual void HandleMouseMove(MouseEventArgs e, Form form)
A MouseEventArgs that contains the event data.
formFormThe parent Form to perform operations on.
Handles the mouse up action by resetting the cursor to default state.
public virtual void HandleMouseUp()
Raises the DoubleClick event and handles the double-click functionality for maximizing/restoring the form.
Handles the maximize/restore button click event and raises the MaximizeRestore event.
Raises the MouseDown event and handles mouse down operations for form manipulation.
protected override void OnMouseDown(MouseEventArgs e)
A MouseEventArgs that contains the event data.
Overrides:
Raises the MouseMove event and handles mouse movement for form resizing and dragging operations.
protected override void OnMouseMove(MouseEventArgs e)
A MouseEventArgs that contains the event data.
Overrides:
Raises the MouseUp event and handles mouse up operations.
protected override void OnMouseUp(MouseEventArgs e)
A MouseEventArgs that contains the event data.
Overrides:
Handles property change notifications and invalidates the element when image properties change.
protected override void OnNotifyPropertyChanged(PropertyChangedEventArgs e)
A PropertyChangedEventArgs that contains the event data.
Overrides:
Raises the property changed notification with the specified property name.
protected override void OnNotifyPropertyChanged(string propertyName)
The name of the property that changed.
Overrides:
Raises the property changed event and handles RTL property changes.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
A RadPropertyChangedEventArgs that contains the event data.
Overrides:
Renders the title bar element with custom background images when all three images (left, right, middle) are specified.
protected override void PaintOverride(IGraphics screenRadGraphics, Rectangle clipRectangle, float angle, SizeF scale, bool useRelativeTransformation)
The graphics object used for rendering.
clipRectangleRectangleThe rectangle that defines the clipping region.
anglefloatThe rotation angle for the rendering.
scaleSizeFThe scale factor for the rendering.
useRelativeTransformationboolA value indicating whether to use relative transformation.
Overrides:
Events
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.
public event TitleBarSystemEventHandler Close
Occurs when a maximize or restore action is performed by the user through the maximize button or by double-clicking the title bar.
public event TitleBarSystemEventHandler MaximizeRestore
Occurs when a minimize action is performed by the user through the minimize button.
public event TitleBarSystemEventHandler Minimize