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 a new instance of the TabbedMdiWindow class.

protected TabbedMdiWindow(TabbedMdiWindowCreationMethod creationMethod)
Parameter Type Description
creationMethod TabbedMdiWindowCreationMethod

A TabbedMdiWindowCreationMethod that indicates how the window was created.

Properties

Active

Gets 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

Gets or sets the BackgroundFill for the window.

public BackgroundFill BackgroundFill { get; set; }

Property Value

BackgroundFill:

The BackgroundFill for a window.

Border

Gets or sets the SimpleBorder for the window.

public SimpleBorder Border { get; set; }

Property Value

SimpleBorder:

The SimpleBorder for a window.

CanClose

Gets or sets whether the window may be closed.

public DefaultableBoolean CanClose { get; set; }

Property Value

DefaultableBoolean:

A DefaultableBoolean that indicates whether the window may be closed.

Remarks

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

ContextImage

Gets or sets 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 context Image displayed for the window. The default value is null.

CreationMethod

Gets a TabbedMdiWindowCreationMethod identifying how the window was created.

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

Property Value

TabbedMdiWindowCreationMethod:

A TabbedMdiWindowCreationMethod identifying how the window was created.

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 display area of the control.

public override Rectangle DisplayRectangle { get; }

Property Value

Rectangle:

A Rectangle that represents the display area of the control.

DockManager

Gets or sets the DockManager that is managing the dock object.

public abstract DockManager DockManager { get; set; }

Property Value

DockManager:

The DockManager that is managing the dock object.

DockObjectType

Gets a DockObjectType specifying the type of dock object.

public abstract DockObjectType DockObjectType { get; }

Property Value

DockObjectType:

A DockObjectType specifying the type of dock object.

Image

Gets or sets the image that is displayed for the window.

public Image Image { get; set; }

Property Value

Image:

The Image displayed for the window. The default value is null.

ImageIndex

Gets or sets 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

Gets 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

Gets or sets a string-based key that identifies an object within its parent collection.

public string Key { get; set; }

Property Value

string:

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

StandardMdiBounds

Gets or sets 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:

The bounds of the standard MDI form.

TabbedMdiContainer

Gets the TabbedMdiContainer that contains the dock object.

public abstract TabbedMdiContainer TabbedMdiContainer { get; }

Property Value

TabbedMdiContainer:

The TabbedMdiContainer that contains the dock object.

Text

Gets or sets the text that is displayed in tabs for the window.

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

Property Value

string:

The text that is displayed in tabs for the window. The default value is null.

TitleBarText

Gets or sets the text that is displayed in title bars for the window.

public string TitleBarText { get; set; }

Property Value

string:

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

ToolTipText

Gets or sets the text that is displayed on a tool tip for the window.

public string ToolTipText { get; set; }

Property Value

string:

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

UseExtendedDoubleBuffering

Gets or sets 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 whether the control is visible. This property should not be used in your code.
Use the Activate() and Close() methods instead.

public bool Visible { get; set; }

Property Value

bool

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:

The Image associated with the window.

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

A TabbedMdiWindowEventArgs that contains the event data.

OnActivating(TabbedMdiWindowEventArgs)

Raises the Activating event.

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

A TabbedMdiWindowEventArgs that contains the event data.

OnClosed(TabbedMdiWindowEventArgs)

Raises the Closed event.

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

A TabbedMdiWindowEventArgs that contains the event data.

OnClosing(TabbedMdiWindowClosingEventArgs)

Raises the Closing event.

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

A TabbedMdiWindowClosingEventArgs that contains 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

A TabbedMdiWindowEventArgs that contains the event data.

OnLeave(EventArgs)

Raises the Leave event.

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

An EventArgs that contains the event data.

OnRender(PaintEventArgs)

Renders the element.

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

A PaintEventArgs that contains the event data.

OnStateChanged(TabbedMdiWindowEventArgs)

Raises the StateChanged event.

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

A TabbedMdiWindowEventArgs that contains 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