Udostępnij za pośrednictwem


Intrinsic Constants and Enumerations

Visual Basic provides a number of intrinsic constants and enumerations to facilitate your programming.

Remarks

Constants store values that remain constant throughout the execution of an application. They are meaningful names that take the place of a number or string and make code more readable. Enumerations offer an easy way to work with sets of related constants. An enumeration, or Enum, is a symbolic name for a set of values.

You can create your own constants and enumerations, as discussed in User-Defined Constants, or you can use the intrinsic constants and enumerations Visual Basic provides, which are listed in the Object Browser.

The following table lists and describes the intrinsic enumerations available in Visual Basic.

Enumeration

Description

AppWinStyle Enumeration

Indicates the window style to use for the invoked program when calling the Shell function.

AudioPlayMode Enumeration

Indicates how to play sounds when calling audio methods.

BuiltInRole Enumeration

Indicates the type of role to check when calling the My.User.IsInRole Method.

CallType Enumeration

Indicates the type of procedure being invoked when calling the CallByName function.

CompareMethod Enumeration

Indicates how to compare strings when calling comparison functions.

DateFormat Enumeration

Indicates how to display dates when calling the FormatDateTime function.

DateInterval Enumeration

Indicates how to determine and format date intervals when calling date-related functions.

DeleteDirectoryOption Enumeration

Specifies what should be done when a directory that is to be deleted contains files or directories.

DueDate Enumeration

Indicates when payments are due when calling financial methods.

FieldType Enumeration

Indicates whether text fields are delimited or fixed-width.

FileAttribute Enumeration

Indicates the file attributes to use when calling file-access functions.

FirstDayOfWeek Enumeration

Indicates the first day of the week to use when calling date-related functions.

FirstWeekOfYear Enumeration

Indicates the first week of the year to use when calling date-related functions.

MsgBoxResult Enumeration

Indicates which button was pressed on a message box, returned by the MsgBox function.

MsgBoxStyle Enumeration

Indicates which buttons to display when calling the MsgBox function.

OpenAccess Enumeration

Identifies whether a file can be read from, written to, or both.

OpenMode Enumeration

Indicates what access mode should be used when accessing a file.

OpenShare Enumeration

Specifies whether other processes can access an open file.

RecycleOption Enumeration

Specifies whether a file should be deleted permanently or placed in the Recycle Bin.

SearchOption Enumeration

Specifies whether to search all or only top-level directories.

TriState Enumeration

Indicates a Boolean value or if the default should be used when calling number-formatting functions.

UICancelOption Enumeration

Specifies what should be done if the user clicks Cancel during an operation.

UIOption Enumeration

Specifies whether or not to show a progress dialog box when copying, deleting, or moving files or directories.

VariantType Enumeration

Indicates the type of a variant object, returned by the VarType function.

VbStrConv Enumeration

Indicates which type of conversion to perform when calling the StrConv function.

See Also

Tasks

How to: Declare A Constant

Concepts

Constants Overview

Constant and Literal Data Types

Enumerations Overview

User-Defined Constants

Reference

Enum Statement (Visual Basic)

Object Browser

Other Resources

Constants and Enumerations (Visual Basic)