ToolWindow
Implements a DockWindow that resides within a ToolTabStrip.
Definition
Namespace:Telerik.WinControls.UI.Docking
Assembly:Telerik.WinControls.RadDock.dll
Syntax:
public class ToolWindow : DockWindow, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl, INotifyPropertyChanged, IDockWindow
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlContainerControlTabPanelDockWindowToolWindow...
Implements:
Inherited Members
Constructors
Initializes a new instance of the ToolWindow class.
public ToolWindow()
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.
Initializes a new instance of the ToolWindow class with the specified text.
public ToolWindow(string text)
The text to display in the window's title bar.
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
Gets or sets the caption text displayed in the tool window's header area.
public string Caption { get; set; }
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.
Gets or sets the action that occurs when this tool window is closed.
public override DockWindowCloseAction CloseAction { get; set; }
A DockWindowCloseAction value indicating the behavior when the window is closed. The default value is Hide.
Overrides:
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
Changes the window state to auto-hide mode.
public void AutoHide()
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.
Changes the window to floating mode with the specified location and size.
public void Float(Point location, Size size)
The screen coordinates where the floating window should appear.
sizeSizeThe size of the floating window.
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.
Changes the window to floating mode with the specified bounds.
public void Float(Rectangle bounds)
The screen coordinates and size of the floating window.
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.
Raises the Paint event.
protected override void OnPaint(PaintEventArgs e)
A PaintEventArgs that contains the event data.
Overrides:
This override skips the paint operation when updates are suspended, which helps prevent visual artifacts during complex layout operations.
Overrides the OnPaintBackground(PaintEventArgs) method.
protected override void OnPaintBackground(PaintEventArgs e)
A PaintEventArgs that contains the event data.
Overrides:
This override skips the background painting when updates are suspended, which helps prevent visual artifacts during complex layout operations.
Resumes drawing operations for a control after they were suspended.
public static void ResumeDrawing(Control control)
The control for which to resume drawing.
This method re-enables visual updates to the control after they were suspended with SuspendDrawing(Control).
Sends a Windows message to the specified window handle.
public static extern int SendMessage(IntPtr hWnd, int wMsg, bool wParam, int lParam)
The handle of the window to receive the message.
wMsgintThe message to send.
wParamboolAdditional message-specific information.
lParamintAdditional message-specific information.
Returns:The result of the message processing.
Performs the work of setting the bounds of the control.
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
The new x-coordinate of the control.
yintThe new y-coordinate of the control.
widthintThe new width of the control.
heightintThe new height of the control.
specifiedBoundsSpecifiedA bitwise combination of the BoundsSpecified values.
Overrides:
This override implements advanced layout logic to preserve child control sizes during complex layout operations, avoiding common issues with anchored and docked controls.
Temporarily suspends drawing operations for the specified control.
public static void SuspendDrawing(Control control)
The control for which to suspend drawing.
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.
Updates the parent ToolTabStrip's caption when this window's caption has changed.
protected virtual void UpdateOnCaptionChanged()
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.
Updates the window's visual representation when the Text property has changed.
protected override void UpdateOnTextChanged()
Overrides:
This method synchronizes the Text property with the parent controls, including updating the caption of floating windows and triggering caption updates.