In This Article

TabbedMdiWindow Class

Provides the base requirements for an object that can be displayed in tabbed MDI.

public abstract class TabbedMdiWindow : UIContainerControl, IUIControl, IUIElement, ILogicalTreeNode, IDpiAwareElement, IDisposable, IDockObject, IImageListProvider
Inheritance:
object MarshalByRefObject Component Control ScrollableControl ContainerControl UIContainerControl object
Derived:
DocumentWindow ToolWindow
Implements:
IUIControl IUIElement ILogicalTreeNode IDpiAwareElement IDisposable IDockObject IImageListProvider

Constructors

TabbedMdiWindow(TabbedMdiWindowCreationMethod)

Initializes an instance of the class.

protected TabbedMdiWindow(TabbedMdiWindowCreationMethod creationMethod)
Parameter Type Description
creationMethod TabbedMdiWindowCreationMethod

A TabbedMdiWindowCreationMethod that indicates how the window was created.

Properties

Active

Indicates whether the window is active.

[Browsable(false)]
public bool Active { get; }

Property Value

bool:

true if the window is active; otherwise, false.

Remarks

An active window is one which is active in the application but not necessarily visible.

If a window is attached to another window in tabbed MDI and they have a TabStrip control determining which one is displayed, both are considered active since they are currently available to be used but only the displayed window is flagged as visible.

BackgroundFill

The BackgroundFill for the window.

public BackgroundFill? BackgroundFill { get; set; }

Property Value

BackgroundFill

Border

The SimpleBorder for the window.

public SimpleBorder? Border { get; set; }

Property Value

SimpleBorder

CanClose

Indicates whether the window may be closed.

public DefaultableBoolean CanClose { get; set; }

Property Value

DefaultableBoolean

Remarks

If set to Default, the resolved value will use the global DockManager setting.

ContextImage

The context image that is displayed for the window on the opposite side of the tab.

public Image? ContextImage { get; set; }

Property Value

Image:

The default value is null.

CreationMethod

A TabbedMdiWindowCreationMethod identifying how the window was created.

[Browsable(false)]
public TabbedMdiWindowCreationMethod CreationMethod { get; }

Property Value

TabbedMdiWindowCreationMethod

DefaultSize

Gets the default size of the control.

protected override Size DefaultSize { get; }

Property Value

Size:

The default Size of the control.

DisplayRectangle

Gets the rectangle that represents the virtual display area of the control.

public override Rectangle DisplayRectangle { get; }

Property Value

Rectangle:

A Rectangle that represents the display area of the control.

DockManager

The DockManager that is managing the dock object.

public abstract DockManager? DockManager { get; set; }

Property Value

DockManager

DockObjectType

A DockObjectType specifying the type of dock object.

public abstract DockObjectType DockObjectType { get; }

Property Value

DockObjectType

Image

The image that is displayed for the window.

public Image? Image { get; set; }

Property Value

Image:

The default value is null.

ImageIndex

The index of an image within an ImageList that is displayed for the window.

[ImageIndex]
[TypeConverter(typeof(ImageIndexConverter))]
public int ImageIndex { get; set; }

Property Value

int:

The index of an image within an ImageList that is displayed for the window. The default value is -1.

IsInitialized

Indicates whether the window has been initialized.

[Browsable(false)]
public bool IsInitialized { get; }

Property Value

bool:

true if the window has been initialized; otherwise, false.

Remarks

A window has been initialized if the WindowInitializing event has been raised for the window. This event fires before the first time the window is activated, allowing for lazy initialization of windows.

Key

A string-based key that identifies an object within its parent collection.

public string? Key { get; set; }

Property Value

string

StandardMdiBounds

The bounds of the standard MDI form, if the window is currently in the MDI area and standard MDI mode is active.

public Rectangle StandardMdiBounds { get; set; }

Property Value

Rectangle

TabbedMdiContainer

The TabbedMdiContainer that contains the dock object.

public abstract TabbedMdiContainer? TabbedMdiContainer { get; }

Property Value

TabbedMdiContainer

Text

Gets or sets the text associated with this control.

[Browsable(true)]
public override string Text { get; set; }

Property Value

string:

The text associated with this control.

TitleBarText

The text that is displayed in title bars for the window.

public string? TitleBarText { get; set; }

Property Value

string:

The default value is null.

ToolTipText

The text that is displayed on a tool tip for the window.

public string? ToolTipText { get; set; }

Property Value

string:

The default value is null.

UseExtendedDoubleBuffering

Indicates whether to use extended double buffering for rendering.

protected override bool UseExtendedDoubleBuffering { get; }

Property Value

bool:

true if extended double buffering should be used; otherwise, false.

Visible

Gets or sets a value indicating whether the control and all its child controls are displayed.

public bool Visible { get; set; }

Property Value

bool:

true to display the control and its child controls; otherwise, false. The default is true. When getting the value, true is returned only if the control is visible and the parent control, if it exists, is visible.

Methods

Activate()

Activates the window and ensures that it is visible.

public void Activate()

Activate(bool)

Activates the window, ensures that it is visible, and optionally sets focus.

public abstract void Activate(bool focus)
Parameter Type Description
focus bool

Whether to set focus to the window.

Close()

Closes the window.

public void Close()

Close(TabbedMdiWindowCloseReason)

Closes the window.

public abstract void Close(TabbedMdiWindowCloseReason reason)
Parameter Type Description
reason TabbedMdiWindowCloseReason

A TabbedMdiWindowCloseReason that specifies why the window was closed.

GetImage()

Returns the Image associated with the window.

public Image? GetImage()

Returns

Image

Remarks

If an image has been set to the Image property, that will be returned. Otherwise, the ImageIndex property will be used to find an image in a parent ImageList.

IsMenuItemChecked(TabbedMdiWindowContextMenuItemType)

Returns whether the specified type of menu item should be checked for the window.

public virtual bool IsMenuItemChecked(TabbedMdiWindowContextMenuItemType menuItemType)
Parameter Type Description
menuItemType TabbedMdiWindowContextMenuItemType

A TabbedMdiWindowContextMenuItemType specifying the type of menu item to examine.

Returns

bool:

true if the menu item type should be checked; otherwise, false.

IsMenuItemEnabled(TabbedMdiWindowContextMenuItemType)

Returns whether the specified type of menu item should be enabled for the window.

public virtual bool IsMenuItemEnabled(TabbedMdiWindowContextMenuItemType menuItemType)
Parameter Type Description
menuItemType TabbedMdiWindowContextMenuItemType

A TabbedMdiWindowContextMenuItemType specifying the type of menu item to examine.

Returns

bool:

true if the menu item type should be enabled; otherwise, false.

IsMenuItemVisible(TabbedMdiWindowContextMenuItemType)

Returns whether the specified type of menu item should be visible for the window.

public virtual bool IsMenuItemVisible(TabbedMdiWindowContextMenuItemType menuItemType)
Parameter Type Description
menuItemType TabbedMdiWindowContextMenuItemType

A TabbedMdiWindowContextMenuItemType specifying the type of menu item to examine.

Returns

bool:

true if the menu item type should be visible; otherwise, false.

MoveToNewHorizontalTabbedMdiContainer()

Creates a new horizontal TabbedMdiContainer for the window.

public void MoveToNewHorizontalTabbedMdiContainer()

Remarks

This method will throw an exception if the window is not currently an active MDI tabbed document.

MoveToNewVerticalTabbedMdiContainer()

Creates a new vertical TabbedMdiContainer for the window.

public void MoveToNewVerticalTabbedMdiContainer()

Remarks

This method will throw an exception if the window is not currently an active MDI tabbed document.

MoveToNextTabbedMdiContainer()

Moves the window to the next TabbedMdiContainer.

public void MoveToNextTabbedMdiContainer()

Remarks

This method will throw an exception if the window is not currently an active MDI tabbed document.

MoveToPositionInTabbedMdiContainer(int)

Moves the window to a new position in the current TabbedMdiContainer.

public void MoveToPositionInTabbedMdiContainer(int index)
Parameter Type Description
index int

The target index.

Remarks

This method will throw an exception if the window is not currently an active MDI tabbed document.

MoveToPreviousTabbedMdiContainer()

Moves the window to the previous TabbedMdiContainer.

public void MoveToPreviousTabbedMdiContainer()

Remarks

This method will throw an exception if the window is not currently an active MDI tabbed document.

OnActivated(TabbedMdiWindowEventArgs)

Raises the Activated event.

protected virtual void OnActivated(TabbedMdiWindowEventArgs e)
Parameter Type Description
e TabbedMdiWindowEventArgs

The event data.

OnActivating(TabbedMdiWindowEventArgs)

Raises the Activating event.

protected virtual void OnActivating(TabbedMdiWindowEventArgs e)
Parameter Type Description
e TabbedMdiWindowEventArgs

The event data.

OnClosed(TabbedMdiWindowEventArgs)

Raises the Closed event.

protected virtual void OnClosed(TabbedMdiWindowEventArgs e)
Parameter Type Description
e TabbedMdiWindowEventArgs

The event data.

OnClosing(TabbedMdiWindowClosingEventArgs)

Raises the Closing event.

protected virtual void OnClosing(TabbedMdiWindowClosingEventArgs e)
Parameter Type Description
e TabbedMdiWindowClosingEventArgs

The event data.

OnEnter(EventArgs)

Raises the Enter event.

protected override void OnEnter(EventArgs e)
Parameter Type Description
e EventArgs

An EventArgs that contains the event data.

OnInitializing(TabbedMdiWindowEventArgs)

Raises the Initializing event.

protected virtual void OnInitializing(TabbedMdiWindowEventArgs e)
Parameter Type Description
e TabbedMdiWindowEventArgs

The event data.

OnRender(PaintEventArgs)

Renders the element.

protected override void OnRender(PaintEventArgs e)
Parameter Type Description
e PaintEventArgs

The event data.

OnStateChanged(TabbedMdiWindowEventArgs)

Raises the StateChanged event.

protected virtual void OnStateChanged(TabbedMdiWindowEventArgs e)
Parameter Type Description
e TabbedMdiWindowEventArgs

The event data.

ResetBackgroundFill()

Resets the BackgroundFill property to its default value.

public virtual void ResetBackgroundFill()

ResetBorder()

Resets the Border property to its default value.

public virtual void ResetBorder()

ResetStandardMdiBounds()

Resets the StandardMdiBounds property to its default value.

public virtual void ResetStandardMdiBounds()

ShouldSerializeBackgroundFill()

Indicates whether the BackgroundFill property should be persisted.

public virtual bool ShouldSerializeBackgroundFill()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeBorder()

Indicates whether the Border property should be persisted.

public virtual bool ShouldSerializeBorder()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializeStandardMdiBounds()

Indicates whether the StandardMdiBounds property should be persisted.

public virtual bool ShouldSerializeStandardMdiBounds()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

UpdateUI()

Updates the user interface that is related to the window.

protected virtual void UpdateUI()

WndProc(ref Message)

Processes Windows messages.

protected override void WndProc(ref Message m)
Parameter Type Description
m Message

The Windows Message to process.

Events

Activated

Occurs after the window is activated from an inactive state and is visible.

public event TabbedMdiWindowEventHandler? Activated

Event Type

TabbedMdiWindowEventHandler

Activating

Occurs before the window is activated from an inactive state.

public event TabbedMdiWindowEventHandler? Activating

Event Type

TabbedMdiWindowEventHandler

Closed

Occurs after the window is deactivated from an active state.

public event TabbedMdiWindowEventHandler? Closed

Event Type

TabbedMdiWindowEventHandler

Closing

Occurs before the window is deactivated from an active state.

public event TabbedMdiWindowClosingEventHandler? Closing

Event Type

TabbedMdiWindowClosingEventHandler

Initializing

Occurs before the window is activated for the first time, allowing for lazy initialization of the window.

public event TabbedMdiWindowEventHandler? Initializing

Event Type

TabbedMdiWindowEventHandler

Remarks

After this event is raised for the window, the window's IsInitialized property is set to true. This event is only called once during the lifetime of the window.

StateChanged

Occurs after the window's state property has changed.

public event TabbedMdiWindowEventHandler? StateChanged

Event Type

TabbedMdiWindowEventHandler

Inherited Members

Extension Methods