Class ToolWindow
Implements a DockWindow that resides within a ToolTabStrip.
Inherited Members
Namespace: Telerik.WinControls.UI.Docking
Assembly: Telerik.WinControls.RadDock.dll
Syntax
public class ToolWindow : DockWindow, INotifyPropertyChanged, IDockWindow
Constructors
ToolWindow()
Initializes a new instance of the ToolWindow class.
Declaration
public ToolWindow()
Remarks
Creates a tool window with default settings. The default close action is set to hide rather than dispose, which is typical behavior for tool windows in docking frameworks.
ToolWindow(String)
Initializes a new instance of the ToolWindow class with the specified text.
Declaration
public ToolWindow(string text)
Parameters
System.String
text
The text to display in the window's title bar. |
Remarks
Creates a tool window with the specified text and default settings. The text appears in both the window's tab and in the caption area when the window is active.
Properties
Caption
Gets or sets the caption text displayed in the tool window's header area.
Declaration
public string Caption { get; set; }
Property Value
System.String
|
Remarks
The caption is displayed in the parent ToolTabStrip when this window is active. Setting this property will update the parent strip's caption text and raise a property changed notification.
CloseAction
Gets or sets the action that occurs when this tool window is closed.
Declaration
public override DockWindowCloseAction CloseAction { get; set; }
Property Value
DockWindowCloseAction
A DockWindowCloseAction value indicating the behavior when the window is closed. The default value is Hide. |
Overrides
Remarks
Tool windows typically hide rather than dispose when closed, allowing them to be reopened later. This differs from document windows which often dispose their resources on close.
Methods
AutoHide()
Changes the window state to auto-hide mode.
Declaration
public void AutoHide()
Remarks
When in auto-hide mode, the window collapses to a tab on the edge of its dock container, and expands when the mouse hovers over the tab. If the window is already in auto-hide mode or is not managed by a DockManager, this method has no effect.
Float(Point, Size)
Changes the window to floating mode with the specified location and size.
Declaration
public void Float(Point location, Size size)
Parameters
System.Drawing.Point
location
The screen coordinates where the floating window should appear. |
System.Drawing.Size
size
The size of the floating window. |
Remarks
This method creates a floating window containing this tool window at the specified location and size. If the window is not managed by a DockManager, this method has no effect.
Float(Rectangle)
Changes the window to floating mode with the specified bounds.
Declaration
public void Float(Rectangle bounds)
Parameters
System.Drawing.Rectangle
bounds
The screen coordinates and size of the floating window. |
Remarks
This method creates a floating window containing this tool window with the specified bounds. If the window is not managed by a DockManager, this method has no effect.
OnPaint(PaintEventArgs)
Raises the System.Windows.Forms.Control.Paint event.
Declaration
protected override void OnPaint(PaintEventArgs e)
Parameters
System.Windows.Forms.PaintEventArgs
e
A System.Windows.Forms.PaintEventArgs that contains the event data. |
Remarks
This override skips the paint operation when updates are suspended, which helps prevent visual artifacts during complex layout operations.
OnPaintBackground(PaintEventArgs)
Overrides the System.Windows.Forms.ScrollableControl.OnPaintBackground(System.Windows.Forms.PaintEventArgs) method.
Declaration
protected override void OnPaintBackground(PaintEventArgs e)
Parameters
System.Windows.Forms.PaintEventArgs
e
A System.Windows.Forms.PaintEventArgs that contains the event data. |
Remarks
This override skips the background painting when updates are suspended, which helps prevent visual artifacts during complex layout operations.
ResumeDrawing(Control)
Resumes drawing operations for a control after they were suspended.
Declaration
public static void ResumeDrawing(Control control)
Parameters
System.Windows.Forms.Control
control
The control for which to resume drawing. |
Remarks
This method re-enables visual updates to the control after they were suspended with SuspendDrawing(Control).
SendMessage(IntPtr, Int32, Boolean, Int32)
Sends a Windows message to the specified window handle.
Declaration
public static int SendMessage(IntPtr hWnd, int wMsg, bool wParam, int lParam)
Parameters
System.IntPtr
hWnd
The handle of the window to receive the message. |
System.Int32
wMsg
The message to send. |
System.Boolean
wParam
Additional message-specific information. |
System.Int32
lParam
Additional message-specific information. |
Returns
System.Int32
The result of the message processing. |
SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified)
Performs the work of setting the bounds of the control.
Declaration
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
Parameters
System.Int32
x
The new x-coordinate of the control. |
System.Int32
y
The new y-coordinate of the control. |
System.Int32
width
The new width of the control. |
System.Int32
height
The new height of the control. |
System.Windows.Forms.BoundsSpecified
specified
A bitwise combination of the System.Windows.Forms.BoundsSpecified values. |
Remarks
This override implements advanced layout logic to preserve child control sizes during complex layout operations, avoiding common issues with anchored and docked controls.
SuspendDrawing(Control)
Temporarily suspends drawing operations for the specified control.
Declaration
public static void SuspendDrawing(Control control)
Parameters
System.Windows.Forms.Control
control
The control for which to suspend drawing. |
Remarks
This method prevents visual updates to the control, which can improve performance during complex operations that would otherwise cause flicker. Always call ResumeDrawing(Control) after the operations are complete.
UpdateOnCaptionChanged()
Updates the parent ToolTabStrip's caption when this window's caption has changed.
Declaration
protected virtual void UpdateOnCaptionChanged()
Remarks
This method is called whenever the Caption property changes or when the Text property changes. It ensures that the parent strip displays the correct caption text when this window is active.
UpdateOnTextChanged()
Updates the window's visual representation when the Text property has changed.
Declaration
protected override void UpdateOnTextChanged()
Overrides
Remarks
This method synchronizes the Text property with the parent controls, including updating the caption of floating windows and triggering caption updates.