BarManager.ShowCloseButton Property

Syntax

C#

public bool ShowCloseButton { get; set; }

VB

Public Property ShowCloseButton As Boolean

Property value

Type: Boolean
true if the close button is displayed; otherwise, false.
The default is false.

Remarks

Set the ShowCloseButton property to true to enable the close button ('x'). This button is displayed at the right edge of the main menu, if there is no main menu it's hidden. In an MDI application, this button will also be hidden when a child MDI form is maximized.

The image below shows the close button being highlighted:

By default, the close button does not implement any specific functionality. To respond to an end-user clicking on this button, you can handle the CloseButtonClick event. For instance, you can handle this event to close a currently active window that has no title, etc.