Working with Intrinsic Controls

Intrinsic controls are controls built into the run time as part of the forms package; intrinsic controls thus exist only on a form. Because the toolkit does not support control arrays, controls exist on the form as discrete, rather than grouped, elements.

The Windows CE Toolkit for Visual Basic 6.0 supplies the following intrinsic controls.

Label Control ListBox Control
TextBox Control HScrollBar Control
Frame Control VScrollBar Control
CommandButton Control Timer Control
CheckBox Control Shape Control
OptionButton Control Line Control
ComboBox Control  

In addition, menu items created with the Menu Editor are intrinsic controls.

Because the intrinsic controls supplied by the toolkit are similar to the corresponding Visual Basic 6.0 controls, this section provides only the basic features of the controls. For in-depth information about using intrinsic controls, see the Visual Basic 6.0 Help.

You can display data in an intrinsic control by setting properties and calling methods. In addition, an intrinsic control can receive user input through events. The events can indicate when the contents or settings of an intrinsic control has changed. They also can indicate when the control has the focus and when mouse and keyboard events have occurred.

The Change, DropDown, and Scroll events indicate when an application or user changes the contents or settings of a control. The following table shows which properties generate a Change event in certain controls.

Control
Property
ComboBox or TextBox Text
Label Caption
Scrollbar Value

The DropDown event occurs when a user causes the list of a ComboBox to drop down. The Scroll event occurs when a user scrolls through the drop-down list. The Scroll event also occurs in response to a user scrolling a ListBox or Scrollbar control.

In addition, many intrinsic controls respond to mouse and keyboard actions. Most controls support the Click and DblClick events, the MouseDown, MouseMove, and MouseUp events, and the KeyDown, KeyPress, and KeyUp events. The Timer control can generate a Timer event, although it cannot react to user input.

If the KeyPreview property is set to True, a form receives keyboard events before controls on the form receive the events. The KeyDown and KeyUp events are not invoked for the following keys:

An intrinsic control can receive keyboard and mouse events only if the control has the focus. Controls can receive the focus only if the Enabled and Visible properties are set to True. When an intrinsic control receives or loses the focus, the control initiates the corresponding GotFocus or LostFocus event. When all visible controls are disabled, the form receives the focus.

While the behavior of intrinsic controls in Visual Basic for Windows CE 6.0 is largely identical to the behavior of intrinsic controls in Visual Basic 6.0, several intrinsic controls shown in the Visual Basic Toolbox, such as the DriveListBox, DirListBox, and FileListBox controls, are unavailable in Windows CE-based projects. Instead, you can use the FileSystem ActiveX control to interact with files and with the file system. In addition, in the toolkit the PictureBox and Image are ActiveX controls, rather than intrinsic controls. There are no equivalent controls for the Data and OLE intrinsic controls.