Skip to main content
Version: 1.0.0-preview.33

Velaptor.UI.ControlBase

Velaptor

Velaptor.UI

ControlBase Class

Represents a basic control with behavior that is shared among all controls.

public abstract class ControlBase :
Velaptor.UI.IControl,
Velaptor.IUpdatable,
Velaptor.IDrawable,
Velaptor.Content.IContentLoadable,
Velaptor.UI.ISizable

Inheritance System.Object → ControlBase

Derived
Button
Label
TextBox

Implements IControl, IUpdatable, IDrawable, IContentLoadable, ISizable

Properties

Bottom

Gets or sets the position of the bottom of the control.

public virtual int Bottom { get; set; }

Implements Bottom

Property Value

System.Int32

Enabled

Gets or sets a value indicating whether or not the control is enabled.

public virtual bool Enabled { get; set; }

Implements Enabled

Property Value

System.Boolean

HalfHeight

Gets the half height of the ControlBase.

public virtual uint HalfHeight { get; }

Implements HalfHeight

Property Value

System.UInt32

HalfWidth

Gets the half width of the ControlBase.

public virtual uint HalfWidth { get; }

Implements HalfWidth

Property Value

System.UInt32

Height

Gets or sets the height of the ControlBase.

public virtual uint Height { get; set; }

Implements Height

Property Value

System.UInt32

IsLoaded

Gets a value indicating whether or not the content for an object is loaded.

public bool IsLoaded { get; set; }

Implements IsLoaded

Property Value

System.Boolean

IsMouseOver

Gets a value indicating whether or not the mouse is hovering over the button.

public bool IsMouseOver { get; set; }

Implements IsMouseOver

Property Value

System.Boolean

Left

Gets or sets the position of the left side of the control.

public virtual int Left { get; set; }

Implements Left

Property Value

System.Int32

MouseDownColor

Gets or sets the color to apply to the control when the
mouse button is in the down position over the control.

public System.Drawing.Color MouseDownColor { get; set; }

Property Value

System.Drawing.Color

MouseHoverColor

Gets or sets the color to apply to the control when the mouse button is hovering over the control.

public System.Drawing.Color MouseHoverColor { get; set; }

Property Value

System.Drawing.Color

Name

Gets or sets the name of the control.

public string Name { get; set; }

Implements Name

Property Value

System.String

Position

Gets or sets the position of the IControl on the screen.

public virtual System.Drawing.Point Position { get; set; }

Implements Position

Property Value

System.Drawing.Point

Gets or sets the position of the right side of the control.

public virtual int Right { get; set; }

Implements Right

Property Value

System.Int32

Top

Gets or sets the position of the top of the control.

public virtual int Top { get; set; }

Implements Top

Property Value

System.Int32

Visible

Gets or sets a value indicating whether or not the control is visible.

public virtual bool Visible { get; set; }

Implements Visible

Property Value

System.Boolean

Width

Gets or sets the width of the ControlBase.

public virtual uint Width { get; set; }

Implements Width

Property Value

System.UInt32

Methods

LoadContent()

Unloads the content for an object.

public virtual void LoadContent();

Implements LoadContent()

Render()

Renders the control to the screen.

public virtual void Render();

Implements Render()

UnloadContent()

Unloads the content for an object.

public virtual void UnloadContent();

Implements UnloadContent()

Update(FrameTime)

A user interface object that can be updated and rendered to the screen.

public virtual void Update(Velaptor.FrameTime frameTime);

Parameters

frameTime FrameTime

Implements Update(FrameTime)

Events

ControlBase.Click Event

Occurs when the button has been clicked.

public event EventHandler<EventArgs>? Click;

Implements Click

Event Type

System.EventHandler<System.EventArgs>

ControlBase.KeyDown Event

Occurs when a keyboard key is pressed into the down position.

public event EventHandler<KeyEventArgs>? KeyDown;

Implements KeyDown

Event Type

System.EventHandler<KeyEventArgs>

ControlBase.KeyUp Event

Occurs when a keyboard key is released into the up position.

public event EventHandler<KeyEventArgs>? KeyUp;

Implements KeyUp

Event Type

System.EventHandler<KeyEventArgs>

ControlBase.MouseDown Event

Occurs when the left mouse button is in the down position over the button.

public event EventHandler<EventArgs>? MouseDown;

Implements MouseDown

Event Type

System.EventHandler<System.EventArgs>

ControlBase.MouseMove Event

Occurs when the mouse moves over the button.

public event EventHandler<MouseMoveEventArgs>? MouseMove;

Implements MouseMove

Event Type

System.EventHandler<MouseMoveEventArgs>

ControlBase.MouseUp Event

Occurs when the left mouse button is in the up position over the button
after the mouse has been in the down position.

public event EventHandler<EventArgs>? MouseUp;

Implements MouseUp

Event Type

System.EventHandler<System.EventArgs>