View
218
Download
1
Tags:
Embed Size (px)
Citation preview
1
Prototyping for HCI
Spring 2004 (Week 10)Jorge A. Toro
2
The Language
Custom Controls
HCI430 – J.Toro 3
Custom Controls
Controls are graphic objects that represent the properties or operations of other objects
VB.NET Allows you to create your own set of controls
HCI430 – J.Toro 4
HCI430 – J.Toro 5
HCI430 – J.Toro 6
HCI430 – J.Toro 7
Custom Controls
There are different kinds of custom controls We will focus in the simplest ones You can add any controls you want similar to
what you do when creating forms
HCI430 – J.Toro 8
Example
Custom label
HCI430 – J.Toro 9
Custom Controls
HCI430 – J.Toro 10
Adding properties
Two sections Get
What the property returns if someone tries to read it
Set What the property
receives if someone tries to write in it
Public Property Title() Get Return label1.text End Get Set(ByVal Value) label1.text = Value End SetEnd Property
HCI430 – J.Toro 11
Using the Control
The custom control will appear in the control toolbox.
Drag the control over the form just as any other control.
Warning! You need to compile the project first before putting the control in.
HCI430 – J.Toro 12
HCI430 – J.Toro 13
Using the control
The properties window will show the properties you defined for the control as well as others that come by default
HCI430 – J.Toro 14
Questions?