150 likes | 176 Views
Learn how to design and implement custom controls in VB.NET to enhance user interface functionality. Explore different types of custom controls and add properties to customize interactions. Step-by-step guide for beginners.
E N D
Prototyping for HCI Spring 2004 (Week 10) Jorge A. Toro
The Language Custom Controls
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
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
Example • Custom label
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 Adding properties Public Property Title() Get Return label1.text EndGet Set(ByVal Value) label1.text = Value EndSet EndProperty
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.
Using the control • The properties window will show the properties you defined for the control as well as others that come by default