Class RadTitleBar
Represents a title bar control that provides custom window management functionality. This control helps in creating borderless forms by substituting the system title bar. Subscribe to RadTitleBar events to implement custom actions for window operations. Use the Visual Style Builder to change the default appearance and configure visible elements.
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadTitleBar : RadControl, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IPCHost, IAnalyticsProvider
Constructors
RadTitleBar()
Initializes a new instance of the RadTitleBar class with default settings.
Declaration
public RadTitleBar()
Properties
AllowResize
Gets or sets a value indicating whether the parent form can be resized through the title bar.
Declaration
public bool AllowResize { get; set; }
Property Value
System.Boolean
|
CanManageOwnerForm
Gets or sets a value indicating whether the title bar can manage the parent form's window operations. When enabled, the title bar will handle form moving, resizing, and state changes.
Declaration
public bool CanManageOwnerForm { get; set; }
Property Value
System.Boolean
|
DefaultSize
Gets the default size of the RadTitleBar control.
Declaration
protected override Size DefaultSize { get; }
Property Value
System.Drawing.Size
A System.Drawing.Size representing the default dimensions (220x23 pixels). |
ImageIcon
Gets or sets the icon displayed in the title bar.
Declaration
public Icon ImageIcon { get; set; }
Property Value
System.Drawing.Icon
|
LeftImage
Gets or sets the image displayed on the left side of the title bar background.
Declaration
public Image LeftImage { get; set; }
Property Value
System.Drawing.Image
|
RightImage
Gets or sets the image displayed on the right side of the title bar background.
Declaration
public Image RightImage { get; set; }
Property Value
System.Drawing.Image
|
Text
Gets or sets the text displayed in the title bar caption.
Declaration
public override string Text { get; set; }
Property Value
System.String
|
Overrides
TitleBarElement
Gets the RadTitleBarElement instance that represents the main element in the hierarchy. This element encapsulates the actual functionality and UI logic of the RadTitleBar control.
Declaration
public RadTitleBarElement TitleBarElement { get; }
Property Value
RadTitleBarElement
|
Methods
CreateAccessibilityInstance()
Creates an accessibility object for the RadTitleBar control.
Declaration
protected override AccessibleObject CreateAccessibilityInstance()
Returns
System.Windows.Forms.AccessibleObject
An System.Windows.Forms.AccessibleObject that provides accessibility support for the control. |
CreateChildItems(RadElement)
Creates the child elements for the RadTitleBar control.
Declaration
protected override void CreateChildItems(RadElement parent)
Parameters
RadElement
parent
The parent RadElement that will contain the child elements. |
Overrides
CreateTitleBarElement()
Creates a new instance of RadTitleBarElement for this control.
Declaration
protected virtual RadTitleBarElement CreateTitleBarElement()
Returns
RadTitleBarElement
A new RadTitleBarElement instance. |
OnBackgroundImageChanged(EventArgs)
Raises the System.Windows.Forms.Control.BackgroundImageChanged event and updates the title bar element's middle image.
Declaration
protected override void OnBackgroundImageChanged(EventArgs e)
Parameters
System.EventArgs
e
An System.EventArgs that contains the event data. |
OnClose(Object, EventArgs)
Handles the close operation by raising the Close event and closing the parent form.
Declaration
protected virtual 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. |
OnHelpButtonClicked(Object, EventArgs)
Handles the help button click event by sending a help context message to the parent form.
Declaration
protected virtual void OnHelpButtonClicked(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 operation by raising the MaximizeRestore event and toggling the parent form's window state.
Declaration
protected virtual 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 operation by raising the Minimize event and minimizing the parent form.
Declaration
protected virtual 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. |
OnMinimizeInTheTray(Object, EventArgs)
Handles the minimize to system tray operation by raising the MinimizeInTheTray event.
Declaration
protected virtual void OnMinimizeInTheTray(object sender, EventArgs args)
Parameters
System.Object
sender
The source of the event. |
System.EventArgs
args
An System.EventArgs that contains the event data. |
OnMove(Object, EventArgs)
Handles the move operation by sending a move message to the parent form.
Declaration
protected virtual void OnMove(object sender, EventArgs e)
Parameters
System.Object
sender
The source of the event. |
System.EventArgs
e
An System.EventArgs that contains the event data. |
OnParentChanged(EventArgs)
Raises the System.Windows.Forms.Control.ParentChanged event and manages form association and event subscriptions.
Declaration
protected override void OnParentChanged(EventArgs e)
Parameters
System.EventArgs
e
An System.EventArgs that contains the event data. |
Overrides
OnSize(Object, EventArgs)
Handles the size operation by sending a resize message to the parent form.
Declaration
protected virtual void OnSize(object sender, EventArgs e)
Parameters
System.Object
sender
The source of the event. |
System.EventArgs
e
An System.EventArgs that contains the event data. |
OnTextChanged(EventArgs)
Raises the System.Windows.Forms.Control.TextChanged event and updates the title bar element text.
Declaration
protected override void OnTextChanged(EventArgs e)
Parameters
System.EventArgs
e
An System.EventArgs that contains the event data. |
ResetBackColorThemeOverrides()
Resets the background color theme overrides for the title bar element.
Declaration
protected override void ResetBackColorThemeOverrides()
Overrides
ResetForeColorThemeOverrides()
Resets the foreground color theme overrides for the title bar element.
Declaration
protected override void ResetForeColorThemeOverrides()
Overrides
SetBackColorThemeOverrides()
Sets the background color theme overrides for the title bar element.
Declaration
protected override void SetBackColorThemeOverrides()
Overrides
SetForeColorThemeOverrides()
Sets the foreground color theme overrides for the title bar element.
Declaration
protected override void SetForeColorThemeOverrides()
Overrides
WndProc(ref Message)
Processes Windows messages for the control, with special handling for help cursor operations.
Declaration
protected override void WndProc(ref Message m)
Parameters
System.Windows.Forms.Message
m
The Windows System.Windows.Forms.Message to process. |
Overrides
Events
Close
Occurs when the close button is clicked or a close action is triggered.
Declaration
public event TitleBarSystemEventHandler Close
Event Type
TitleBarSystemEventHandler
|
MaximizeRestore
Occurs when the maximize/restore button is clicked, the title bar is double-clicked, or a maximize/restore action is triggered.
Declaration
public event TitleBarSystemEventHandler MaximizeRestore
Event Type
TitleBarSystemEventHandler
|
Minimize
Occurs when the minimize button is clicked or a minimize action is triggered.
Declaration
public event TitleBarSystemEventHandler Minimize
Event Type
TitleBarSystemEventHandler
|
MinimizeInTheTray
Occurs when the minimize to system tray button is clicked. This button is hidden by default. Use the Visual Style Builder to configure which elements are visible and customize their appearance.
Declaration
public event TitleBarSystemEventHandler MinimizeInTheTray
Event Type
TitleBarSystemEventHandler
|