Controls Reference

This section provides a comprehensive reference to the various controls available within the MSDN framework. These controls are the building blocks for creating rich and interactive user interfaces.

Core Controls

The following are fundamental controls that form the basis of most UI elements:

Button

A clickable element that triggers an action.

Properties

Name Type Description
Text string The text displayed on the button.
OnClick function Handler for the click event.
IsEnabled boolean Determines if the button is interactive.

Example

C#:

Button myButton = new Button();
myButton.Text = "Click Me";
myButton.OnClick += (sender, args) => {
    MessageBox.Show("Button clicked!");
};

TextBox

An input field for text entry.

Properties

Name Type Description
Value string The current text in the textbox.
Placeholder string Hint text displayed when the textbox is empty.
IsReadOnly boolean If true, the user cannot edit the text.

Example

JavaScript:

let nameInput = new TextBox();
nameInput.Placeholder = "Enter your name";
nameInput.onValueChange = (newValue) => {
    console.log("New value: " + newValue);
};

Label

Displays static text.

Properties

Name Type Description
Text string The text to display.

Layout Controls

These controls help organize other elements on the page.

Panel

A container that can group and position other controls.

Properties

Name Type Description
Children List<Control> A collection of child controls within the panel.
LayoutMode Enum Defines how children are arranged (e.g., Stack, Grid).

Grid

A control that arranges child elements in a row and column format.

Properties

Name Type Description
Rows int Number of rows.
Columns int Number of columns.
Cell(row, col) Control Access or set a control at a specific cell.

Advanced Controls

Specialized controls for more complex scenarios.

ListView

Displays a collection of items, allowing for selection and interaction.

Properties

Name Type Description
ItemsSource IEnumerable<object> The data source for the list.
SelectedItem object The currently selected item.
ItemTemplate ControlTemplate Defines the visual representation of each item.

TreeView

Represents hierarchical data in a tree-like structure.

Properties

Name Type Description
RootNodes IEnumerable<TreeNode> The top-level nodes of the tree.
SelectedNode TreeNode The currently selected node.

Explore the API section for detailed information on each control's methods and events.