Class Control
Abstract base class for all control models
public abstract class Control
- Inheritance
-
Control
- Derived
- Inherited Members
- Extension Methods
Constructors
Control(Dialog)
Create a new instance of a control
protected Control(Dialog parent)
Parameters
parent
Dialog
Fields
IsDefault
public bool IsDefault
Field Value
boundingBox
protected Rectangle boundingBox
Field Value
controlId
protected int controlId
Field Value
controlX
protected int controlX
Field Value
controlY
protected int controlY
Field Value
ctrlHotKey
protected Keys ctrlHotKey
Field Value
ctrlType
protected ControlType ctrlType
Field Value
elementList
protected List<Element> elementList
Field Value
enabled
protected bool enabled
Field Value
hasFocus
protected bool hasFocus
Field Value
height
protected int height
Field Value
index
public uint index
Field Value
isMouseOver
protected bool isMouseOver
Field Value
localUserData
protected object localUserData
Field Value
parentDialog
protected Dialog parentDialog
Field Value
visible
protected bool visible
Field Value
width
protected int width
Field Value
Properties
CanHaveFocus
Can the control have focus
public virtual bool CanHaveFocus { get; }
Property Value
ControlType
Type of the control
public virtual ControlType ControlType { get; }
Property Value
Hotkey
The controls hotkey
public virtual Keys Hotkey { get; set; }
Property Value
ID
Unique ID of the control
public virtual int ID { get; set; }
Property Value
IsEnabled
Is the control enabled
public virtual bool IsEnabled { get; set; }
Property Value
IsVisible
Is the control visible
public virtual bool IsVisible { get; set; }
Property Value
this[uint]
Index for the elements this control has access to
public Element this[uint elementIndex] { get; set; }
Parameters
elementIndex
uint
Property Value
Parent
The parent dialog of this control
public Dialog Parent { get; }
Property Value
UserData
User specified data
public object UserData { get; set; }
Property Value
Methods
ContainsPoint(Point)
Does the control contain this point
public virtual bool ContainsPoint(Point pt)
Parameters
pt
Point
Returns
HandleKeyboard(WindowMessage, IntPtr, IntPtr)
Handle the keyboard data
public virtual bool HandleKeyboard(WindowMessage msg, IntPtr wParam, IntPtr lParam)
Parameters
msg
WindowMessagewParam
IntPtrlParam
IntPtr
Returns
HandleMouse(WindowMessage, Point, IntPtr, IntPtr)
Handle the mouse data
public virtual bool HandleMouse(WindowMessage msg, Point pt, IntPtr wParam, IntPtr lParam)
Parameters
msg
WindowMessagept
PointwParam
IntPtrlParam
IntPtr
Returns
MsgProc(IntPtr, WindowMessage, IntPtr, IntPtr)
Message Handler
public virtual bool MsgProc(IntPtr hWnd, WindowMessage msg, IntPtr wParam, IntPtr lParam)
Parameters
hWnd
IntPtrmsg
WindowMessagewParam
IntPtrlParam
IntPtr
Returns
OnFocusIn()
Called when control gets focus
public virtual void OnFocusIn()
OnFocusOut()
Called when control loses focus
public virtual void OnFocusOut()
OnHotKey()
Called when the control's hotkey is hit
public virtual void OnHotKey()
OnInitialize()
Initialize the control
public virtual void OnInitialize()
OnMouseEnter()
Called when mouse goes over the control
public virtual void OnMouseEnter()
OnMouseExit()
Called when mouse leaves the control
public virtual void OnMouseExit()
Refresh()
Refreshes the control
public virtual void Refresh()
Render(Device, float)
Render the control
public abstract void Render(Device device, float elapsedTime)
Parameters
device
DeviceelapsedTime
float
SetLocation(int, int)
Called to set control's location
public virtual void SetLocation(int x, int y)
Parameters
SetSize(int, int)
Called to set control's size
public virtual void SetSize(int w, int h)
Parameters
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
UpdateRectangles()
Updates the rectangles
protected virtual void UpdateRectangles()
Events
MouseEnter
public event EventHandler MouseEnter
Event Type
MouseExit
public event EventHandler MouseExit