Change Event (placeholder)


Click Event (placeholder)


DblClick Event (placeholder)


DragDrop Event (placeholder)


DragOver Event (placeholder)


KeyDown Event (placeholder)


KeyPress Event (placeholder)


KeyUp Event (placeholder)


MouseDown Event (placeholder)


MouseMove Event (placeholder)


MouseUp Event (placeholder)


OLECompleteDragEvent (placeholder)


OLEDragDrop Event (placeholder)


OLEDragOver Event (placeholder)


OLEGiveFeedback Event (placeholder)


OLESetData Event (placeholder)


OLEStartDrag Event (placeholder)


Refresh Method (placeholder)


OLEDrag Method (placeholder)


Appearance Property (placeholder)


BackColor Property (placeholder)


Caption Property (placeholder)


Enabled Property (placeholder)


Font Property (placeholder)


ForeColor Property (placeholder)


IntegralHeight Property (placeholder)


Locked Property (placeholder)


MouseIcon Property (placeholder)


MousePointer Property (placeholder)


OLEDragMode Property (placeholder)


OLEDropMode Property (placeholder)


SelLength Property (placeholder)


SelStart Property (placeholder)


SelText Property (placeholder)


Style Property (placeholder)


Text Property (placeholder)


Keyword Not Found

The keyword you've selected can't be found in Visual Basic Help. It's possible that:

•	The keyword is misspelled

•	You selected too much or too little text

•	You asked for help on a word that is not a valid Visual Basic keyword.

The easiest way to get help on a specific keyword is to position the insertion point anywhere within the keyword you want help on and press F1. You do not need to select the keyword. In fact, if you select only a portion of the keyword, or more than a single word, Help will not find what you're looking for.

To use the built-in Help search dialog box, press the Help Topics button on the toolbar.

One option to possibly find what you're looking for is to view the ReadMe file that comes with Visual Basic. This document contains information regarding last-minute changes, additions, and deletions that did not make it into the final documentation.


Left, Top Properties (Placeholder)


Height, Width Properties (Placeholder)


Tag Property (Placeholder)


ToolTipText Property (Placeholder)


Count Property (Placeholder)


Item Method (Placeholder)


Hwnd Property (Placeholder)


TabStop Property (Placeholder)


Visible Property (Placeholder)


Picture Property (placeholder)


Max, Min Properties (placeholder)


Add Method (placeholder)


Clear Method (placeholder)


Container Property (placeholder)


Controls Collection (placeholder)


Copies Property (placeholder)


DataBinding Object (placeholder)


DataBindings Collection (placeholder)


Filename Property (placeholder)


FontBold, FontItalic, FontStrikeThru Properties (placeholder)


FontName Property (placeholder)


FontSize Property (placeholder)


GetData Method (placeholder)


GetFormat Method (placeholder)


HelpFile Property (placeholder)


Item Property (placeholder)


Remove Method (placeholder)


SetData Method (placeholder)


Align Property (placeholder)


DragIcon Property (placeholder)


DragMode Property (placeholder)


HelpContextID Property (placeholder)


TabIndex Property (placeholder)


Alignment Constants (placeholder)


Border Property Constants (placeholder)


BorderStyle Constants (placeholder)


BorderStyle Property (ActiveX Controls) (placeholder)


Clear Method (ActiveX Controls) (placeholder)


Clipboard Object Constants (placeholder)


Color Constants (placeholder)


CommonDialog Control Constants (placeholder)


CommonDialog Error Constants (placeholder)


Control Constants (placeholder)


DataBindings Property (placeholder)


DDE Constants (placeholder)


Drag-and-Drop Constants (placeholder)


Drawing Constants (placeholder)


FetchVerbs Method (placeholder)


Form Constants (placeholder)


Graphics Constants (placeholder)


Grid Control Constants (placeholder)


Help Constants (placeholder)


HideSelection Property (ActiveX Controls) (placeholder)


HideSelection Property (placeholder)


Image Property (ActiveX Controls) (placeholder)


ImageList Property (ActiveX Controls) (placeholder)


Index Property (ActiveX Controls) (placeholder)


Index Property (placeholder)


Key Code Constants (placeholder)


Key Property (ActiveX Controls) (placeholder)


Menu Accelerator Constants (placeholder)


Menu Control Constants (placeholder)


Miscellaneous Constants (placeholder)


MousePointer Constants (placeholder)


OLE Container Control Constants (placeholder)


Picture Object Constants (placeholder)


Printer Object Constants (placeholder)


RasterOp Constants (placeholder)


Remove Method (ActiveX Controls) (placeholder)


ShowInTaskbar Property (placeholder)


ShowTips Property (ActiveX Controls) (placeholder)


ShowWhatsThis Method (placeholder)


Text Property (ActiveX Controls) (placeholder)


Value Property (ActiveX Controls) (placeholder)


Variant Type Constants (placeholder)


Visual Basic Constants (placeholder)


WhatsThisButton Property (placeholder)


WhatsThisHelp Property (placeholder)


WhatsThisHelpID Property (placeholder)


WhatsThisMode Method (placeholder)


Windows 95 Control Constants (placeholder)


ColIsVisible Property (placeholder)


ColPos Property (placeholder)


DataObject Object (placeholder)


DataObjectFiles Collection (placeholder)


DataSource Property (placeholder)


Drag Method (placeholder)


DrawMode Property (placeholder)


FixedAlignment Property (placeholder)


GotFocus Event (placeholder)


GridLineWidth Property (placeholder)


Index Property (Control Array) (placeholder)


LostFocus Event (placeholder)


Move Method (placeholder)


Name Property (placeholder)


Object Property (placeholder)


Parent Property (placeholder)


RowColChange Event (placeholder)


RowIsVisible Property (placeholder)


RowPos Property (placeholder)


SetFocus Method (placeholder)


ZOrder Method (placeholder)


Files Method (placeholder)


Connect Event (placeholder)


HScrollSmallChange, VScrollSmallChange Properties (placeholder)


MinHeight, MinWidth Properties (placeholder)


Property Pages Dialog Box (placeholder)


RemoteHost Property (placeholder)


RemotePort Property (placeholder)


ViewportHeight, ViewportLeft, ViewportTop, ViewportWidth Properties (placeholder)


Resync Method (Remote Data) (placeholder)


ContainedVBControls Collection (placeholder)


Member Object (placeholder)


Members Collection (placeholder)


VBComponentsEvents Object (placeholder)


VBProjectsEvents Object (placeholder)


Files Property (placeholder)


Alignment Property (placeholder)


AboutBox Method (placeholder)


Col, Row Properties (placeholder)


RowHeight Property (placeholder)


Scroll Event (placeholder)


ScrollBars Property (placeholder)


SelEndCol, SelStartCol, SelEndRow, SelStartRow Properties (placeholder)


ScrollBars Property (placeholder)


ACStatus Property

Returns a value that indicates whether or not the system is using AC power.

Syntax

object.ACStatus

The object placeholder represents an object expression that evaluates to an object in the Applies To list.

Settings

The ACStatus property settings are:

Setting	Description
0	The system is not using AC power.
1	The system is using AC power.
255	AC power status is unknown.


ACStatus Property Example

This example uses a Label control on a form to show the status of the system's AC power. To run this example, put a SysInfo control, a Label control and a Timer control on a form. Paste this code into the Timer event of the Timer control. Set the Interval property of the Timer control to 5000, then run the example.

Private Sub Timer1_Timer()

Select Case SysInfo1.ACStatus

Case 0

Label1.Caption = "AC Power: Off"

Case 1

Label1.Caption = "AC Power: On"

Case 255

Label1.Caption = "AC Power: Unknown"

End Select

End Sub


BatteryFullTime Property

Returns a value that indicates the full charge life of the battery.

Syntax

object.BatteryFullTime

The object placeholder represents an object expression that evaluates to an object in the Applies To list.

Remarks

The BatteryFullTime property returns the number of seconds of life in the battery when at full charge. If the battery’s full charge life time is unknown, this property returns the value &HFFFFFFFF.


BatteryFullTime Property Example

This example displays the amount of total battery time in hours and minutes. To run this example, put a SysInfo control and a CommandButton control on a form. Paste this code into the Click event of the CommandButton control, then run the example.

Private Sub Command1_Click()

    ' BatteryLifeTime Property Example

    If SysInfo1.BatteryLifeTime <> &HFFFFFFFF Then

        Dim TimeLeft As String

        Dim TimeTotal As String

        Dim temp

        temp = TimeSerial(0, 0, SysInfo1.BatteryLifeTime)

        TimeLeft = Format(temp, "h:mm")

        temp = TimeSerial(0, 0, SysInfo1.BatteryFullTime)

        TimeTotal = Format(temp, "h:mm")

        MsgBox TimeLeft & " time left from " & TimeTotal & " total."

    Else

        MsgBox "Cannot determine remaining battery time."

    End If

End Sub


BatteryLifePercent Property

Returns the percentage of full battery power remaining.

Syntax

object.BatteryLifePercent

The object placeholder represents an object expression that evaluates to an object in the Applies To list.

Settings

The BatteryLifePercent property settings are:

Setting	Description
0 - 100	Percentage of full battery charge remaining.
255	Battery charge status is unknown.


BatteryLifePercent Property Example

This example uses a ProgressBar control on a form to show the status of the system battery's remaining power. To run this example, put a SysInfo control, a ProgressBar control and a Timer control on a form. Paste this code into the Timer event of the Timer control. Set the Interval property of the Timer control to 5000, then run the example.

Private Sub Timer1_Timer()

If SysInfo1.BatteryLifePercent <> 255 Then

ProgressBar1.Value = SysInfo1.BatteryLifePercent

ProgressBar1.Enabled = True

Else

ProgressBar1.Value = 0

ProgressBar1.Enabled = False

End If

End Sub


BatteryLifeTime Property

Returns a value that indicates the remaining life of the battery.

Syntax

object.BatteryLifeTime

The object placeholder represents an object expression that evaluates to an object in the Applies To list.

Remarks

The BatteryLifeTime property returns the number of seconds of life remaining in the battery. If the battery life time is unknown, this property returns the value &HFFFFFFFF.


BatteryLifeTime Property Example

This example displays the amount of remaining battery time in hours and minutes. To run this example, put a SysInfo control and a CommandButton control on a form. Paste this code into the Click event of the CommandButton control. Then run the example.

Private Sub Command1_Click()

    ' BatteryLifeTime Property Example

    If SysInfo1.BatteryLifeTime <> &HFFFFFFFF Then

        Dim TimeLeft As String

        Dim TimeTotal As String

        Dim temp

        temp = TimeSerial(0, 0, SysInfo1.BatteryLifeTime)

        TimeLeft = Format(temp, "h:mm")

        temp = TimeSerial(0, 0, SysInfo1.BatteryFullTime)

        TimeTotal = Format(temp, "h:mm")

        MsgBox TimeLeft & " time left from " & TimeTotal & " total."

    Else

        MsgBox "Cannot determine remaining battery time."

    End If

End Sub


BatteryStatus Property

Returns a value that indicates the status of the battery’s charge.

Syntax

object.BatteryStatus

The object placeholder represents an object expression that evaluates to an object in the Applies To list.

Settings

The BatteryStatus property settings are:

Setting	Description
1	Battery charge is high.
2	Battery charge is low.
4	Battery charge is critical.
8	Battery is charging.
128	The system has no battery.
255	Battery charge status is unknown.


BatteryStatus Property Example

This example updates a Label control each time there is a change in power status so the application displays current battery status information. To run this example, put a SysInfo control and a Label control on a form. Paste this code into the PowerStatusChanged event of the SysInfo control. Then run the example.

Private Sub SysInfo1_PowerStatusChanged()

Select Case SysInfo1.BatteryStatus

Case 1

Label1.Caption = "Battery OK"

Case 2

Label1.Caption = "Battery Low"

Case 4

Label1.Caption = "Battery Critical"

Case 8

Label1.Caption = "Battery Charging"

Case 128, 255

Label1.Caption = "No Battery Status"

End Select

End Sub


ConfigChangeCancelled Event

Occurs when the operating system sends a message to all applications that a change to the hardware profile was cancelled.

Syntax

Private Sub object_ConfigChangeCancelled([index As Integer])

The ConfigChangeCancelled event syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
index	A numeric expression that evaluates to the index of a control if it is in a control array.
Remarks

You should use this event to clean up any processing begun in the QueryChangeConfig event procedure.


ConfigChanged Event

Occurs when the hardware profile on the system has changed.

Syntax

Private Sub object_ConfigChanged([index As Integer,] ByVal oldconfignum As Long, ByVal newconfignum As Long)

The ConfigChanged event syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
index	A numeric expression that evaluates to the index of a control if it is in a control array.
oldconfignum	The key name in the Windows registry for the old system configuration.
newconfignum	The key name in the Windows registry for the new system configuration.
Remarks

For docking and undocking a portable computer with a docking station, this event occurs after the system resumes operation.


DeviceArrival Event

Occurs when a new device is added to the system.

Syntax

Private Sub object_DeviceArrival([index As Integer,] ByVal devicetype As Long, ByVal deviceid As Long, ByVal devicename As String, ByVal devicedata As Long)

The DeviceArrival event syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
index	A numeric expression that evaluates to the index of a control if it is in a control array.
devicetype	A value that indicates the type of device that has been added, as described in Settings.
deviceid	A value that identifies the device, as described in Settings.
devicename	Null for all settings of devicetype except DeviceTypePort. When devicetype is DeviceTypePort, then devicename is dbcp_name.
devicedata	A value as described in Settings.
Settings

The settings for devicetype are:

Constant	Value	Description
DeviceTypeOEM	0	OEM-defined device type.
DeviceTypeDevNode	1	Devnode number (Windows 95).
DeviceTypeVolume	2	Logical volume (disk drive).
DeviceTypePort	3	Serial or parallel port.
DeviceTypeNet	4	Network resource
The settings for deviceid are:

devicetype Setting	deviceid Setting
DeviceTypeOEM	dbco_identifier
DeviceTypeDevNode	dbcd_devnode
DeviceTypeVolume	dbcv_unitmask
DeviceTypePort	Null
DeviceTypeNet	dbcn_resource
The settings for devicedata are:

devicetype Setting	devicedata Setting
DeviceTypeOEM	dbco_suppfunc
DeviceTypeDevNode	Null
DeviceTypeVolume	dbcv_flags
DeviceTypePort	Null
DeviceTypeNet	dbcn_flags
Remarks

This event is very useful if your application can dynamically make use of new hardware.


DeviceOtherEvent Event

A notification event that does not map onto the general events.

Syntax

Private Sub object_DeviceOtherEvent([index As Integer,] ByVal devicetype As Long, ByVal eventname As String, ByVal datapointer As Long)

The DeviceOtherEvent event syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
index	A numeric expression that evaluates to the index of a control if it is in a control array.
devicetype	A value that indicates the type of device that will process events, as described in Settings.
eventname	A string expression that evaluates to the name of an event.
datapointer	A long value that points to device-specific data.
Settings

The settings for devicetype are:

Constant	Value	Description
DeviceTypeOEM	0	OEM-defined device type.
DeviceTypeDevNode	1	Devnode number (Windows 95).
DeviceTypeVolume	2	Logical volume (disk drive).
DeviceTypePort	3	Serial or parallel port.
DeviceTypeNet	4	Network resource


DeviceQueryRemove Event

Occurs just before a device is removed from the system.

Syntax

Private Sub object_DeviceQueryRemove([index As Integer,] ByVal devicetype As Long, ByVal deviceid As Long, ByVal devicename As String, ByVal devicedata As Long, cancel As Boolean)

The DeviceQueryRemove event syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
index	A numeric expression that evaluates to the index of a control if it is in a control array.
devicetype	A value that indicates the type of device that has been added, as described in Settings.
deviceid	A value that identifies the device, as described in Settings.
devicename	Null for all settings of devicetype except DeviceTypePort. When devicetype is DeviceTypePort, then devicename is dbcp_name.
devicedata	A value as described in Settings.
cancel	A Boolean value, as described in Settings.
Settings

The settings for devicetype are:

Constant	Value	Description
DeviceTypeOEM	0	OEM-defined device type.
DeviceTypeDevNode	1	Devnode number (Windows 95).
DeviceTypeVolume	2	Logical volume (disk drive).
DeviceTypePort	3	Serial or parallel port.
DeviceTypeNet	4	Network resource
The settings for deviceid are:

devicetype Setting	deviceid Setting
DeviceTypeOEM	dbco_identifier
DeviceTypeDevNode	dbcd_devnode
DeviceTypeVolume	dbcv_unitmask
DeviceTypePort	Null
DeviceTypeNet	dbcn_resource
The settings for devicedata are:

devicetype Setting	devicedata Setting
DeviceTypeOEM	dbco_suppfunc
DeviceTypeDevNode	Null
DeviceTypeVolume	dbcv_flags
DeviceTypePort	Null
DeviceTypeNet	dbcn_flags
The settings for cancel are:

Setting	Description
True	The system is preventing the device from being removed.
False	The system allows the device to be removed.
Remarks

This event takes place only if the process responsible for removing the device sends the required message to the operating system before the device is removed.


DeviceQueryRemoveFailed Event

Occurs if code in the DeviceQueryRemove event cancelled the removal of a device.

Syntax

Private Sub object_DeviceQueryRemoveFailed([index As Integer,] ByVal devicetype As Long, ByVal deviceid As Long, ByVal devicename As String, ByVal devicedata As Long, cancel As Boolean)

The DeviceQueryRemoveFailed event syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
index	A numeric expression that evaluates to the index of a control if it is in a control array.
devicetype	A value that indicates the type of device that has been added, as described in Settings.
deviceid	A value that identifies the device, as described in Settings.
devicename	Null for all settings of devicetype except DeviceTypePort. When devicetype is DeviceTypePort, then devicename is dbcp_name.
devicedata	A value as described in Settings.
cancel	A Boolean value, as described in Settings.


Settings

The settings for devicetype are:

Constant	Value	Description
DeviceTypeOEM	0	OEM-defined device type.
DeviceTypeDevNode	1	Devnode number (Windows 95).
DeviceTypeVolume	2	Logical volume (disk drive).
DeviceTypePort	3	Serial or parallel port.
DeviceTypeNet	4	Network resource
The settings for deviceid are:

devicetype Setting	deviceid Setting
DeviceTypeOEM	dbco_identifier
DeviceTypeDevNode	dbcd_devnode
DeviceTypeVolume	dbcv_unitmask
DeviceTypePort	Null
DeviceTypeNet	dbcn_resource
The settings for devicedata are:

devicetype Setting	devicedata Setting
DeviceTypeOEM	dbco_suppfunc
DeviceTypeDevNode	Null
DeviceTypeVolume	dbcv_flags
DeviceTypePort	Null
DeviceTypeNet	dbcn_flags
The settings for cancel are:

Setting	Description
True	The system is preventing the device from being removed.
False	The system allows the device to be removed.


DeviceRemoveComplete Event

Occurs after a device is removed.

Syntax

Private Sub object_DeviceQueryRemove([index As Integer,] ByVal devicetype As Long, ByVal deviceid As Long, ByVal devicename As String, ByVal devicedata As Long, cancel As Boolean)

The DeviceRemoveComplete event syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
index	A numeric expression that evaluates to the index of a control if it is in a control array.
devicetype	A value that indicates the type of device that has been added, as described in Settings.
deviceid	A value that identifies the device, as described in Settings.
devicename	Null for all settings of devicetype except DeviceTypePort. When devicetype is DeviceTypePort, then devicename is dbcp_name.
devicedata	A value as described in Settings.
cancel	A Boolean value, as described in Settings.
Settings

The settings for devicetype are:

Constant	Value	Description
DeviceTypeOEM	0	OEM-defined device type.
DeviceTypeDevNode	1	Devnode number (Windows 95).
DeviceTypeVolume	2	Logical volume (disk drive).
DeviceTypePort	3	Serial or parallel port.
DeviceTypeNet	4	Network resource
The settings for deviceid are:

devicetype Setting	deviceid Setting
DeviceTypeOEM	dbco_identifier
DeviceTypeDevNode	dbcd_devnode
DeviceTypeVolume	dbcv_unitmask
DeviceTypePort	Null
DeviceTypeNet	dbcn_resource
The settings for devicedata are:

devicetype Setting	devicedata Setting
DeviceTypeOEM	dbco_suppfunc
DeviceTypeDevNode	Null
DeviceTypeVolume	dbcv_flags
DeviceTypePort	Null
DeviceTypeNet	dbcn_flags
The settings for cancel are:

Setting	Description
True	The system is preventing the device from being removed.
False	The system allows the device to be removed.
Remarks

In some cases this event occurs even though no other device removal event occurred.


DeviceRemovePending Event

Occurs after all applications have given approval to remove a device and the device is about to be removed.

Syntax

Private Sub object_DeviceRemovePending([index As Integer,] ByVal devicetype As Long, ByVal deviceid As Long, ByVal devicename As String, ByVal devicedata As Long, cancel As Boolean)

The DeviceRemovePending event syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
index	A numeric expression that evaluates to the index of a control if it is in a control array.
devicetype	A value that indicates the type of device that has been added, as described in Settings.
deviceid	A value that identifies the device, as described in Settings.
devicename	Null for all settings of devicetype except DeviceTypePort. When devicetype is DeviceTypePort, then devicename is dbcp_name.
devicedata	A value as described in Settings.
cancel	A Boolean value, as described in Settings.


Settings

The settings for devicetype are:

Constant	Value	Description
DeviceTypeOEM	0	OEM-defined device type.
DeviceTypeDevNode	1	Devnode number (Windows 95).
DeviceTypeVolume	2	Logical volume (disk drive).
DeviceTypePort	3	Serial or parallel port.
DeviceTypeNet	4	Network resource
The settings for deviceid are:

devicetype Setting	deviceid Setting
DeviceTypeOEM	dbco_identifier
DeviceTypeDevNode	dbcd_devnode
DeviceTypeVolume	dbcv_unitmask
DeviceTypePort	Null
DeviceTypeNet	dbcn_resource
The settings for devicedata are:

devicetype Setting	devicedata Setting
DeviceTypeOEM	dbco_suppfunc
DeviceTypeDevNode	Null
DeviceTypeVolume	dbcv_flags
DeviceTypePort	Null
DeviceTypeNet	dbcn_flags
The settings for cancel are:

Setting	Description
True	The system is preventing the device from being removed.
False	The system allows the device to be removed.


DevModeChange Event

Occurs when the user changes device mode settings.

Syntax

Private Sub object_DevModeChange([index As Integer,] ByVal devicename As String)

The DevModeChange event syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
index	A numeric expression that evaluates to the index of a control if it is in a control array.
devicename	A string expression that identifies a device name specified in the Windows registry.


DisplayChanged Event

Occurs when system screen resolution changes.

Syntax

Private Sub object_DisplayChanged([index As Integer])

The DisplayChanged event syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
index	A numeric expression that evaluates to the index of a control if it is in a control array.
Remarks

Use this event to make any adjustments you need to the interface of your application due to changes in screen resolution.


DisplayChanged Event Example

This example tests the size of the active form after a change in screen resolution, and adjusts the size of the form if it exceeds the visible screen area. To run this example, put a SysInfo control on a form. Paste this code into the DisplayChanged event of the SysInfo control. Run the example then change the screen resolution.

Private Sub SysInfo1_DisplayChanged()

    If Screen.ActiveForm.Width > SysInfo1.WorkAreaWidth Then

        Screen.ActiveForm.Left = SysInfo1.WorkAreaLeft

        Screen.ActiveForm.Width = SysInfo1.WorkAreaWidth

    End If

    If Screen.ActiveForm.Height > SysInfo1.WorkAreaHeight Then

        Screen.ActiveForm.Top = SysInfo1.WorkAreaTop

        Screen.ActiveForm.Height = SysInfo1.WorkAreaHeight

    End If

End Sub


Index Property

Returns or sets the number that uniquely identifies a control in a control array. Available only if the control is part of a control array.

Syntax

object[(number)].Index

The Index property syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
number	A numeric expression that evaluates to an integer that identifies an individual control within a control array.
Settings

The settings for number are:

Setting	Description
No value	(Default) Not part of a control array.
0 to 32,767	Part of an array. Specifies an integer greater than or equal to 0 that identifies a control within a control array. All controls in a control array have the same Name property. Visual Basic automatically assigns the next integer available within the control array.
Remarks

Because control array elements share the same Name property setting, you must use the Index property in code to specify a particular control in the array. Index must appear as an integer (or a numeric expression evaluating to an integer) in parentheses next to the control array name, for example, MyButtons(3). You can also use the Tag property setting to distinguish one control from another within a control array.

When a control in the array recognizes that an event has occurred, Visual Basic calls the control array's event procedure and passes the applicable Index setting as an additional argument. This property is also used when you create controls dynamically at run time with the Load statement or remove them with the Unload statement.

Although Visual Basic assigns, by default, the next integer available as the value of Index for a new control in a control array, you can override this assigned value and skip integers. You can also set Index to an integer other than 0 for the first control in the array. If you reference an Index value in code that doesn't identify one of the controls in a control array, a Visual Basic run-time error occurs.

Note   To remove a control from a control array, change the control's Name property setting, and delete the control's Index property setting.


Left Property

Returns or sets the distance between the internal left edge of an object and the left edge of its container.

Syntax

object.Left [= value]

The Left property syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
value	A numeric expression specifying distance.
Remarks

For a control, the Left property is always expressed in units depending on the coordinate system of its container. The values for these properties change as the object is moved by the user or by code.


Name Property

Returns the name used in code to identify a SysInfo control.

Syntax

object.Name

The object placeholder represents an object expression that evaluates to an object in the Applies To list. If object is omitted, the form associated with the active form module is assumed to be object.

Remarks

The default name for new objects is the kind of object plus a unique integer. For example, the first new form object is Form1, a new SysInfo control is SysInfo1, and the third TextBox control you create on a form is Text3.

An object's Name property must start with a letter and can be a maximum of 40 characters. It can include numbers and underline (_) characters but can't include punctuation or spaces. Forms can't have the same name as another public object such as Clipboard, Screen, or App. Although the Name property setting can be a keyword, property name, or the name of another object, this can create conflicts in your code.

You can create an array of controls of the same type by setting the Name property to the same value. For example, when you set the name of all option buttons in a group to MyOpt, Visual Basic assigns unique values to the Index property of each control to distinguish it from others in the array. Two controls of different types can't share the same name.


OSBuild Property

Returns a value that provides information about the operating system under which the application is currently running. Not available at design time.

Syntax

object.OSBuild

The object placeholder represents an object expression that evaluates to an object in the Applies To list.


OSPlatform Property

Returns a value that identifies the operating system under which the application is currently running. Not available at design time.

Syntax

object.OSPlatform

The object placeholder represents an object expression that evaluates to an object in the Applies To list.

Return Values

The OSPlatform property returns these values:

Value	Description
0	Win32s
1	Windows 95
2	Windows NT


OSPlatform Property Example

This example displays the current operating system and version number. To run this example, put a SysInfo control and a CommandButton control on a form. Then paste the example into the form's Declarations section, run the project and click the CommandButton.

Private Sub Command1_Click()

Dim MsgEnd As String

Select Case SysInfo1.OSPlatform

Case 0

MsgEnd = “Unidentified”

Case 1

MsgEnd = “Windows 95, ver. “ & CStr(SysInfo1.OSVersion)

Case 2

MsgEnd = “Windows NT, ver. “ & CStr(SysInfo1.OSVersion)

End Select

MsgBox “System: “ & MsgEnd

End Sub


OSVersion Property

Returns a value that identifies the version of the operating system under which the application is currently running. Not available at design time.

Syntax

object.OSVersion

The object placeholder represents an object expression that evaluates to an object in the Applies To list.


OSVersion Property Example

This example displays the current operating system and version number. To run this example, put a SysInfo control and a CommandButton control on a form. Then paste the example into the form's Declarations section, run the project and click the CommandButton.

Private Sub Command1_Click()

Dim MsgEnd As String

Select Case SysInfo1.OSPlatform

Case 0

MsgEnd = “Unidentified”

Case 1

MsgEnd = “Windows 95, ver. “ & CStr(SysInfo1.OSVersion)

Case 2

MsgEnd = “Windows NT, ver. “ & CStr(SysInfo1.OSVersion)

End Select

MsgBox “System: “ & MsgEnd

End Sub


PowerQuerySuspend Event

Occurs when system power is about to be suspended.

Syntax

Private Sub object_PowerQuerySuspend([index As Integer,] cancel As Boolean)

The PowerQuerySuspend event syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
index	A numeric expression that evaluates to the index of a control if it is in a control array.
cancel	A Boolean value that indicates whether or not the system will be prevented from entering suspended mode, as described in Settings.
Settings

The settings for cancel are:

Setting	Description
True	Prevents the system from entering suspended mode.
False	(Default) Allows the system to enter suspended mode.


PowerResume Event

Occurs when the system comes out of suspend mode and applications resume normal operations.

Syntax

Private Sub object_PowerResume([index As Integer])

The PowerResume event syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
index	A numeric expression that evaluates to the index of a control if it is in a control array.


PowerStatusChanged Event

Occurs when there is a change in the power status of the system.

Syntax

Private Sub object_PowerStatusChanged([index As Integer])

The PowerStatusChanged event syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
index	A numeric expression that evaluates to the index of a control if it is in a control array.
Remarks

The following changes in the system's power status triggers the PowerStatusChanged event:

•	Battery running low

•	Switching power from AC to battery and vice versa

•	Battery has completed charging


PowerStatusChanged Event Example

This example updates a Label control each time there is a change in power status so the application displays current battery status information. To run this example, put a SysInfo control and a Label control on a form. Paste this code into the PowerStatusChanged event of the SysInfo control. Then run the example.

Private Sub SysInfo1_PowerStatusChanged()

Select Case SysInfo1.BatteryStatus

Case 1

Label1.Caption = "Battery OK"

Case 2

Label1.Caption = "Battery Low"

Case 4

Label1.Caption = "Battery Critical"

Case 8

Label1.Caption = "Battery Charging"

Case 128, 255

Label1.Caption = "No Battery Status"

End Select

End Sub


PowerSuspend Event

Occurs immediately before the system goes into suspend mode.

Syntax

Private Sub object_PowerSuspend([index As Integer])

The PowerSuspend event syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
index	A numeric expression that evaluates to the index of a control if it is in a control array.


QueryChangeConfig Event

Occurs on a request to change the current hardware profile, either through the operating system user interface or by requesting suspend mode prior to docking or undocking the system.

Syntax

Private Sub object_QueryChangeConfig([index As Integer,] cancel As Boolean)

The QueryChangeConfig event syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
index	A numeric expression that evaluates to the index of a control if it is in a control array.
cancel	A Boolean value, as described in Settings.
Settings

The settings for cancel are:

Setting	Description
True	Prevents the system from changing the hardware profile.
False	(Default) Allows the system to change the hardware profile.


ScrollBarSize Property

Returns the system metric for the width of a scroll bar in twips.

Syntax

object.ScrollBarSize

The object placeholder represents an object expression that evaluates to an object in the Applies To list.


SettingChanged Event

Occurs when an application changes a systemwide parameter.

Syntax

Private Sub object_SettingChanged([index As Integer,] ByVal item As Integer, ByVal section As Integer)

The SettingChanged event syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
index	A numeric expression that evaluates to the index of a control if it is in a control array.
item	A long integer that contains system parameter information that has changed. If the message is not sent from USER32, then that system parameter (which is the WPARAM from the WM_SETTINGCHANGE and corresponds to a parameter for the win32 API routine, SystemParameterInfo) is always zero. Many of the various control panel applets cause this message to be sent, but they do it themselves, not from USER32. Under these conditions, you may get 0 as the value in this event.
section	A string expression that evaluates to the name of the section containing the system parameter that changed.
Remarks

You can use the SettingChanged event to detect a number of useful system changes. One of the most useful changes you can detect is when a user moves or resizes the Windows 95 taskbar.


SysColorsChanged Event

Occurs when a system color setting changes, either by an application or through the Control Panel.

Syntax

Private Sub object_SysColorsChanged([index As Integer])

The SysColorsChanged event syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
index	A numeric expression that evaluates to the index of a control if it is in a control array.


SysInfo Control

The SysInfo control allows you to respond to certain system messages sent to all applications by the operating system. Your application can then adapt to changes in the operating system if necessary.

Syntax

SysInfo

Remarks

Using the SysInfo control, you can monitor information provided by the operating system as well as respond to system-generated events. The features of this control fall into one of these groups:

•	Events tied to changes in the system (DisplayChanged, TimeChanged, and SettingChanged events, for example).

•	Power status events and properties (PowerSuspend, PowerResume events and ACStatus and BatteryStatus properties, for example).

•	Plug and Play events (DeviceArrival, DeviceRemoveComplete events, for example).

•	Operating system properties (OSVersion and WorkAreaHeight properties, for example).


Tag Property

Returns or sets an expression that stores any extra data needed for your program. Unlike other properties, the value of the Tag property isn't used by Visual Basic; you can use this property to identify objects.

Syntax

object.Tag

object.Tag [= expression]

The Tag property syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
expression	A string expression identifying the object. The default is a zero-length string ("").
Remarks

You can use this property to assign an identification string to an object without affecting any of its other property settings or causing side effects.


TimeChanged Event

Occurs when the system time changes, either by an application or through the Control Panel.

Syntax

Private Sub object_TimeChanged([index As Integer])

The TimeChanged event syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
index	A numeric expression that evaluates to the index of a control if it is in a control array.


Top Property

Returns or sets the distance between the internal top edge of an object and the top edge of its container.

Syntax

object.Top [= value]

The Top property syntax has these parts:

Part	Description
object	An object expression that evaluates to an object in the Applies To list.
value	A numeric expression specifying distance.


WorkAreaHeight Property

Returns the height of the visible desktop adjusted for the Windows 95 taskbar. Not available at design time.

Syntax

object.WorkAreaHeight

The object placeholder represents an object expression that evaluates to an object in the Applies To list.

Remarks

When the taskbar appears along the top or bottom of the screen, the WorkAreaHeight property tells you the height of the visible desktop less the height of the taskbar.


WorkAreaHeight Property Example

This example tests the size of the active form after a change in screen resolution and adjusts the size of the form if it exceeds the visible screen area. To run this example, put a SysInfo control on a form. Paste this code into the DisplayChanged event of the SysInfo control. Run the example and change the screen resolution.

Private Sub SysInfo1_DisplayChanged()

    If Screen.ActiveForm.Width > SysInfo1.WorkAreaWidth Then

        Screen.ActiveForm.Left = SysInfo1.WorkAreaLeft

        Screen.ActiveForm.Width = SysInfo1.WorkAreaWidth

    End If

    If Screen.ActiveForm.Height > SysInfo1.WorkAreaHeight Then

        Screen.ActiveForm.Top = SysInfo1.WorkAreaTop

        Screen.ActiveForm.Height = SysInfo1.WorkAreaHeight

    End If

End Sub


WorkAreaLeft Property

Returns the coordinate for the left edge of the visible desktop adjusted for the Windows 95 taskbar. Not available at design time.

Syntax

object.WorkAreaLeft

The object placeholder represents an object expression that evaluates to an object in the Applies To list.


WorkAreaLeft Property Example

This example tests the size of the active form after a change in screen resolution and adjusts the size of the form if it exceeds the visible screen area. To run this example, put a SysInfo control on a form. Paste this code into the DisplayChanged event of the SysInfo control. Run the example then change the screen resolution.

Private Sub SysInfo1_DisplayChanged()

    If Screen.ActiveForm.Width > SysInfo1.WorkAreaWidth Then

        Screen.ActiveForm.Left = SysInfo1.WorkAreaLeft

        Screen.ActiveForm.Width = SysInfo1.WorkAreaWidth

    End If

    If Screen.ActiveForm.Height > SysInfo1.WorkAreaHeight Then

        Screen.ActiveForm.Top = SysInfo1.WorkAreaTop

        Screen.ActiveForm.Height = SysInfo1.WorkAreaHeight

    End If

End Sub


WorkAreaTop Property

Returns the coordinate for the top edge of the visible desktop adjusted for the Windows 95 taskbar. Not available at design time.

Syntax

object.WorkAreaTop

The object placeholder represents an object expression that evaluates to an object in the Applies To list.


WorkAreaTop Property Example

This example tests the size of the active form after a change in screen resolution and adjusts the size of the form if it exceeds the visible screen area. To run this example, put a SysInfo control on a form. Paste this code into the DisplayChanged event of the SysInfo control. Run the example, then change the screen resolution.

Private Sub SysInfo1_DisplayChanged()

    If Screen.ActiveForm.Width > SysInfo1.WorkAreaWidth Then

        Screen.ActiveForm.Left = SysInfo1.WorkAreaLeft

        Screen.ActiveForm.Width = SysInfo1.WorkAreaWidth

    End If

    If Screen.ActiveForm.Height > SysInfo1.WorkAreaHeight Then

        Screen.ActiveForm.Top = SysInfo1.WorkAreaTop

        Screen.ActiveForm.Height = SysInfo1.WorkAreaHeight

    End If

End Sub


WorkAreaWidth Property

Returns the width of the visible desktop adjusted for the Windows 95 taskbar. Not available at design time.

Syntax

object.WorkAreaWidth

The object placeholder represents an object expression that evaluates to an object in the Applies To list.

Remarks

When the taskbar appears along the left or right edge of the screen, the WorkAreaWidth property tells you the width of the visible desktop minus the width of the taskbar.


WorkAreaWidth Property Example

This example tests the size of the active form after a change in screen resolution and adjusts the size of the form if it exceeds the visible screen area. To run this example, put a SysInfo control on a form. Paste this code into the DisplayChanged event of the SysInfo control. Run the example, then change the screen resolution.

Private Sub SysInfo1_DisplayChanged()

    If Screen.ActiveForm.Width > SysInfo1.WorkAreaWidth Then

        Screen.ActiveForm.Left = SysInfo1.WorkAreaLeft

        Screen.ActiveForm.Width = SysInfo1.WorkAreaWidth

    End If

    If Screen.ActiveForm.Height > SysInfo1.WorkAreaHeight Then

        Screen.ActiveForm.Top = SysInfo1.WorkAreaTop

        Screen.ActiveForm.Height = SysInfo1.WorkAreaHeight

    End If

End Sub


Appearance Property (ActiveX Controls) (placeholder)


BackColor, ForeColor Properties (ActiveX Controls) (placeholder)


BorderStyle Constants (ActiveX Controls) (placeholder)


Caption Property (ActiveX Controls) (placeholder)


Change Event (ActiveX Controls) (placeholder)


Clear Method (ActiveX Controls) (placeholder)


Click Event (ActiveX Controls) (placeholder)


Clipboard Object Constants (ActiveX Controls) (placeholder)


Count Property (ActiveX Controls) (placeholder)


DataObject Object (ActiveX Controls) (placeholder)


DataObjectFiles Collection (ActiveX Controls) (placeholder)


DataSource Property (ActiveX Controls) (placeholder)


DblClick Event (ActiveX Controls) (placeholder)


Drag-and-Drop Constants (ActiveX Controls) (placeholder)


Enabled Property (ActiveX Controls) (placeholder)


FetchVerbs Method (ActiveX Controls) (placeholder)


Files Method (ActiveX Controls) (placeholders)


Font Property (ActiveX Controls) (placeholder)


FontName Property (ActiveX Controls) (placeholder)


FontSize Property (ActiveX placeholder)


GetData Method (ActiveX Controls) (placeholder)


GetFormat Method (ActiveX Controls) (placeholder)


HideSelection Property (ActiveX Controls) (complaceholder)


hWnd Property (ActiveX Controls) (placeholder)


Item Method (ActiveX Controls) (placeholder)


Key Code Constants (ActiveX Controls) (placeholder)


Key Property (ActiveX Controls) (complaceholder)


KeyDown, KeyUp Events (ActiveX Controls) (placeholder)


KeyPress Event (ActiveX Controls) (placeholder)


Max, Min Properties (ActiveX Controls) (placeholder)


MouseDown, MouseUp Events (ActiveX Controls) (placeholder)


MouseIcon Property (ActiveX Controls) (placeholder)


MouseMove Event (ActiveX Controls) (placeholder)


MousePointer Constants (ActiveX Controls) (placeholder)


MousePointer Property (ActiveX Controls) (placeholder


OLECompleteDrag Event (ActiveX Controls) (placeholder)


OLEDrag Method (ActiveX Controls) (placeholder)


OLEDragDrop Event (ActiveX Controls) (placeholder)


OLEDragMode Property (ActiveX Controls) (placeholder)


OLEDragOver Event (ActiveX Controls) (placeholder)


OLEDropMode Property (ActiveX Controls) (placeholder)


OLEGiveFeedback Event (ActiveX Controls) (placeholder)


OLESetData Event (ActiveX Controls) (placeholder)


OLEStartDrag Event (ActiveX Controls) (placeholder)


Picture Property (ActiveX Controls) (placeholder)


Property Pages Dialog Box (ActiveX Controls) (placeholder)


RemoteHost Property (ActiveX Controls) (placeholder)


RemotePort Property (ActiveX Controls) (placeholder)


SelLength, SelStart, SelText Properties (ActiveX Controls) (placeholder)


SetData Method (ActiveX Controls) (placeholder)


ShowTips Property (ActiveX Controls) (complaceholder)


Text Property (ActiveX Controls) (complaceholder)


Value Property (ActiveX Controls) (complaceholder)


hDC Property (ActiveX Controls) (complaceholder)


Height, Width Properties (ActiveX Controls) (complaceholder)


Index Property (ActiveX Controls) (complaceholder)


Left, Top Properties (ActiveX Controls) (complaceholder)


Tag Property (ActiveX Controls) (complaceholder)


Visible Property (ActiveX Controls) (complaceholder)


Remove Method (ActiveX Controls) (complaceholder)


Object Property (ActiveX Controls) (placeholder)


Property Pages (ActiveX controls) (placeholder)


No fonts exist (Error 24574) (Common Dialog Control) (complaceholder)


Help Contents placeholder


BorderStyle Property (ActiveX Controls) (placeholder)


RightToLeft Property (ActiveX Controls) (placeholder)


Refresh Method (ActiveX Controls) (placeholder)