StatusBar - ahatornn/clforms GitHub Wiki
ClForms.Elements.StatusBar
Represents a Windows status bar control
public class StatusBar: DockPanel, IElementStyle<StatusBar>Inheritance Control -> ContentControl -> MultipleContentControl -> DockPanel -> StatusBar
Derived IElementStyle<StatusBar>
The following code example creates a StatusBar control with buttons.
var statusBar1 = new StatusBar();
statusBar1.AddHelpButton();
statusBar1.AddContent(new GlyphLabel("[↔↕]", "Move") { GlyphForeground = Color.DarkBlue });
statusBar1.AddContent(new GlyphLabel("[Space]", "Set") { GlyphForeground = Color.DarkBlue });
statusBar1.AddContent(new GlyphLabel("[Del]", "Remove") { GlyphForeground = Color.DarkBlue });
statusBar1.AddLabel("X=1, Y=1", Dock.Right);
StatusBar = statusBar1;You can find more examples of using the StatusBar in this project
The default StatusBar has no buttons. To add panels to a StatusBar you can use the AddContent method. To append Help button use AddHelpButton method.
| Syntax | Description |
|---|---|
| StatusBar() | Initialize a new StatusBar instance |
| Name | Type | Description |
|---|---|---|
| AutoSize | bool | Gets or sets a value indicating whether the control is resized in accordance with its contents |
| Background | Color | Gets or sets a brush that describes the background of a control |
| BackgroundIsTransparent | bool | Gets a value indicating whether the Background has Color.NotSet
|
| Bounds | Rect | Gets the size and location of the control including its nonclient elements, in points, relative to the parent control |
| ContentCount | int | Gets the number of elements contained in the current control |
| DesiredSize | Size | Gets the size that this element computed during the measure pass of the layout process |
| DrawingContext | IDrawingContext | Gets a value of the drawing context |
| Foreground | Color | Gets or sets a brush that describes the text of a control |
| ForegroundIsTransparent | bool | Gets a value indicating whether the Foreground has Color.NotSet
|
| Height | int? | Gets or sets the height of the control |
| Id | long | Gets a value of the control's identifier |
| IsMeasureValid | bool | Gets a value indicating whether component sizing was performed |
| IsVisualValid | bool | Gets a value indicating whether the component is being re-rendered |
| LastChildFill | bool | Gets or sets a value that indicates whether the last child element within a DockPanel stretches to fill the remaining available space |
| Location | Point | Gets or sets the coordinates of the upper-left corner of the control relative to the upper-left corner of its container |
| Margin | Thickness | Gets or sets the outer margin of an element |
| MnemonicForeground | Color | Gets or sets a value indicating the color of the assigned character associated with accessing the buttons |
| Padding | Thickness | Gets or sets a Thickness value that describes the amount of space between a control and its child element |
| Parent | ContentControl | Gets or sets the parent container of the control |
| Tag | object | Gets or sets the object that contains data about the control |
| Width | int? | Gets or sets the width of the control |
| Syntax | Description |
|---|---|
| AddButton(string text, StatusBarShortcutKey shortcutKey, Action action) | Adds a button to the status bar panel with function key access |
| AddButton(string text, StatusBarShortcutKey shortcutKey, Action action, Dock dock) | Adds a button to the status bar panel with function key access and the Dock property value |
| AddContent(Control content) | Adds the specified control to the control collection |
| AddHelpButton(string text) | Adds a help button to the status bar panel with a standard help window. Default value of the text is "Help" |
| AddLabel(string text) | Adds a label with default values and the specified text |
| AddLabel(string text, Dock dock) | Adds a label with default values and the specified text and the Dock property value |
| Arrange(Rect) | Positions child elements and determines a size for a Control. Parent elements call this method from their Arrange(Rect) implementation to form a recursive layout update |
| FindAndClick(ConsoleKeyInfo keyInfo) | Trying to find an item associated with the specified ConsoleKeyInfo |
| GetDock(Control) | Get of the Dock value for a specified control |
| InvalidateMeasure() | Invalidates the measurement state (layout) for the element |
| InvalidateMeasureIfAutoSize() | Invalidates the measurement state (layout) for the element if AutoSize property is true otherwise invalidates the rendering of the element |
| InvalidateVisual() | Invalidates the rendering of the element, and forces a complete new layout pass. OnRender(IDrawingContext) is called after the layout cycle is completed |
| Measure(Size) | Updates DesiredSize of a Control. Parent elements call this method from their own Measure(Size) implementations to form a recursive layout update |
| OnRender(IDrawingContext) | Filling a pseudographics drawing context |
| ParentWindow() | Gets the form the control is in |
| RemoveAllContent() | Removes all items from the control collection |
| RemoveContent(Control) | Remove the specified control to the control collection |
| SetDock(Control, Dock) | Set of the Dock value for a specified control |
| SetStyle(Action) | Defines actions with an element style |
| Event | Description |
|---|---|
| OnAutoSizeChanged | Occurs when the value of the AutoSize property changes |
| OnBackgroundChanged | Occurs when the value of the Background property changes |
| OnForegroundChanged | Occurs when the value of the Foreground property changes |
| OnHeightChanged | Occurs when the value of the Height property changes |
| OnLastChildFillChanged | Occurs when the value of the LastChildFill property changes |
| OnMarginChanged | Occurs when the value of the Margin property changes |
| OnMnemonicForegroundChanged | Occurs when the value of the MnemonicForeground property changes |
| OnPaddingChanged | Occurs when the value of the Padding property changes |
| OnParentChanged | Occurs when the value of the Parent property changes |
| OnTagChanged | Occurs when the value of the Tag property changes |
| OnWidthChanged | Occurs when the value of the Width property changes |