Download as pdf or txt
Download as pdf or txt
You are on page 1of 243

2. 1.

2018 Saved Property (VBA Add-In Object Model) (Visual Basic Add-In Model)

This documentation is archived and is not being maintained.

Visual Basic Extensibility Reference


Visual Studio 6.0

Saved Property
See Also Example Applies To Specifics

Returns a Boolean value indicating whether or not the object was edited since the last time it was saved. Read/write.

Return Values

The Saved property returns these values:

Value Description

True The object has not been edited since the last time it was saved.

False The object has been edited since the last time it was saved.

Remarks

The SaveAs method sets the Saved property to True.

Note If you set the Saved property to False in code, it returns False, and the object is marked as if it were edited since the
last time it was saved.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa445223(v=vs.60).aspx 1/1
2. 1.2018 Saved Property Example (Visual Basic Add-In Model)

Visual Basic Extensibility Reference


Saved Property Example
The following example uses the Saved property to return a Boolean value indicating whether or not the specified project has
been saved in its current state.

Debug.Print Application.VBE.VBProjects(l).Saved

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445225(v=vs.60).aspx 1/1
2. 1.2018 ScaleHeight, ScaleWidth Properties

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

ScaleHeight, ScaleWidth Properties


See Also Example Applies To

Return or set the number of units for the horizontal (ScaleWidth) and vertical (ScaleHeight) measurement of the interior of
an object when using graphics methods or when positioning controls. For MDIForm objects, not available at design time
and read-only at run time.

Syntax

ob/ect.ScaleHeight [= value]

ob/ect.ScaleWidth [= value]

The ScaleHeight and ScaleWidth property syntaxes have these parts:

Part Description

Object An object expression that evaluates to an object in the Applies To list.

Value A numeric expression specifying the horizontal or vertical measurement.

Remarks

You can use these properties to create a custom coordinate scale for drawing or printing. For example, the statement
ScaleH eight = 100 changes the units of measure of the actual interior height of the form. Instead of the height being n
current units (twips, pixels, ...), the height will be 100 user-defined units. Therefore, a distance of 50 units is half the
height/width of the object, and a distance of 101 units will be off the object by 1 unit.

Use the ScaleMode property to define a scale based on a standard unit of measurement, such as twips, points, pixels,
characters, inches, millimeters, or centimeters.

Setting these properties to positive values makes coordinates increase from top to bottom and left to right. Setting them to
negative values makes coordinates increase from bottom to top and right to left.

Using these properties and the related ScaleLeft and ScaleTop properties, you can set up a full coordinate system with both
positive and negative coordinates. All four of these Scale properties interact with the ScaleMode property in the following
ways:

• Setting any other Scale property to any value automatically sets ScaleMode to 0. A ScaleMode of 0 is user-defined.

• Setting ScaleMode to a number greater than 0 changes ScaleHeight and ScaleWidth to the new unit of
measurement and sets ScaleLeft and ScaleTop to 0. In addition, the CurrentX and CurrentY settings change to
reflect the new coordinates of the current point.
https://msdn.microsoft.com/en-us/library/aa445663(v=vs.60).aspx 1/2
2. 1.2018 ScaleHeight, ScaleWidth Properties

You can also use the Scale method to set the ScaleHeight, ScaleWidth, ScaleLeft, and ScaleTop properties in one
statement.

Note The ScaleHeight and ScaleWidth properties aren't the same as the Height and Width properties.

For MDIForm objects, ScaleHeight and ScaleWidth refer only to the area not covered by PictureBox controls in the form.
Avoid using these properties to size a PictureBox in the Resize event of an MDIForm.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445663(v=vs.60).aspx 2/2
2. 1.2018 ScaleHeight, ScaleWidth Properties Example

Visual Basic Reference

ScaleHeight, ScaleWidth Properties Example


This example uses the ScaleHeight and ScaleWidth properties to change the vertical and horizontal units of measurement
for a form. To try this example, paste the code into the Declarations section of a form, and then press F5. To see the effect,
click the form, resize it, and then click it again.

Private Sub Form_Click ()


Dim Radius As Integer ' Declare variable.
ScaleHeight = 100 ' Set height units.
ScaleWidth = 100 ' Set width units.
For Radius = 5 to 50 Step 5
FillStyle = 1
Circle (50, 50), Radius ' Draw circle.
Next Radius
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa445664(v=vs.60).aspx 1/1
2. 1.2018 ScaleLeft, ScaleTop Properties

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

ScaleLeft, ScaleTop Properties


See Also Example Applies To

Return or set the horizontal (ScaleLeft) and vertical (ScaleTop) coordinates for the left and top edges of an object when
using graphics methods or when positioning controls.

Syntax

object.ScaleLeft [= value]

object.ScaleTop [= value]

The ScaleLeft and ScaleTop property syntaxes have these parts:

Part Description

Object An object expression that evaluates to an object in the Applies To list.

Value A numeric expression specifying the horizontal or vertical coordinate. The default is 0.

Remarks

Using these properties and the related ScaleHeight and ScaleWidth properties, you can set up a full coordinate system with
both positive and negative coordinates. These four Scale properties interact with the ScaleMode property in the following
ways:

• Setting any other Scale property to any value automatically sets ScaleMode to 0. A ScaleMode of 0 is user-defined.

• Setting the ScaleMode property to a number greater than 0 changes ScaleHeight and ScaleWidth to the new unit of
measurement and sets ScaleLeft and ScaleTop to 0. The CurrentX and CurrentY property settings change to reflect
the new coordinates of the current point.

You can also use the Scale method to set the ScaleHeight, ScaleWidth, ScaleLeft, and ScaleTop properties in one
statement.

Note The ScaleLeft and ScaleTop properties aren't the same as the Left and Top properties.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445665(v=vs.60).aspx 1/1
2. 1.2018 ScaleLeft, ScaleTop Properties Example

Visual Basic Reference


ScaleLeft, ScaleTop Properties Example
This example creates a grid in a PictureBox control and sets coordinates for the upper-left corner to -1, -1 instead of 0, 0.
Every 0.25 second, dots are randomly plotted from the upper-left corner to the lower-right corner. To try this example, paste
the code into the Declarations section of a form that contains a large PictureBox and a Tim er control, and then press F5.

Private Sub Form_Load ()


Timer1.Interval = 250 ' Set Timer interval.
Picture1.ScaleTop = -1 ' Set scale for top of grid.
Picture1.ScaleLeft = -1 ' Set scale for left of grid.
Picture1.ScaleWidth = 2 ' Set scale (-1 to 1).
Picture1.ScaleHeight = 2
Picture1.Line (-1, 0)-(1, 0) ' Draw horizontal line.
Picture1.Line (0, -1)-(0, 1) ' Draw vertical line.
End Sub

Private Sub Timer1_Timer ()


Dim I ' Declare variable.
' Plot dots randomly within a range.
For I = -1 To 1 Step .05
Picture1.PSet (I * Rnd, I * Rnd) ' Draw a point.
Next I
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445667(v=vs.60).aspx 1/1
2. 1.2018 ScaleMode Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

ScaleMode Property
See Also Example Applies To

Returns or sets a value indicating the unit of measurement for coordinates of an object when using graphics methods or
when positioning controls.

Syntax

ob/ect.ScaleMode [= value]

The ScaleMode property syntax has these parts:

Part Description

Object An object expression that evaluates to an object in the Applies To list.

Value An integer specifying the unit of measurement, as described in Settings.

Settings

The settings for value are:

Constant Setting Description

vbUser 0 Indicates that one or more of the ScaleHeight, ScaleWidth, ScaleLeft, and ScaleTop
properties are set to custom values.

vbTwips 1 (Default) Twip (1440 twips per logical inch; 567 twips per logical centimeter).

vbPoints 2 Point (72 points per logical inch).

vbPixels 3 Pixel (smallest unit of monitor or printer resolution).

vbCharacters 4 Character (horizontal = 120 twips per unit; vertical = 240 twips per unit).

vbInches 5 Inch.

vbMillimeters 6 Millimeter.

vbCentimeters 7 Centimeter.

https://msdn.microsoft.com/en-us/library/aa445668(v=vs.60).aspx 1/2
2. 1.2018 ScaleMode Property

vbHimetric 8 HiMetric

vbContainerPosition 9 Units used by the control's container to determine the control's position.

vbContainerSize 10 Units used by the control's container to determine the control's size.

Remarks

Using the related ScaleHeight, ScaleWidth, ScaleLeft, and ScaleTop properties, you can create a custom coordinate system
with both positive and negative coordinates. These four Scale properties interact with the ScaleMode property in the
following ways:

• Setting the value of any other Scale property to any value automatically sets ScaleMode to 0. A ScaleMode of 0 is
user-defined.

• Setting the ScaleMode property to a number greater than 0 changes ScaleHeight and ScaleWidth to the new unit of
measurement and sets ScaleLeft and ScaleTop to 0. The CurrentX and CurrentY property settings change to reflect
the new coordinates of the current point.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445668(v=vs.60).aspx 2/2
2. 1.2018 ScaleMode Property Example

Visual Basic Reference


ScaleMode Property Example
This example shows how different ScaleMode property settings change the size of a circle. To try this example, paste the
code into the Declarations section of a form, and then press F5 and click the form. When you click the form, the unit of
measurement changes to the next ScaleMode setting and a circle is drawn on the form.

Private Sub Form_Click ()


' Cycle through each of the seven ScaleMode settings.
ScaleMode = ((ScaleMode + 1) Mod 7) + 1
' Draw a circle with radius of 2 in center of form.
Circle (ScaleWidth / 2, ScaleHeight / 2), 2
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445669(v=vs.60).aspx 1/1
2. 1.2018 ScaleUnits Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

ScaleUnits Property
See Also Example Applies To

Returns a string value that is the name of the coordinate units being used by the container.

Syntax

ofa/ecf.ScaleUnits

The ScaleUnits property syntax has this part:

Part Description

object An object expression that evaluates to an object in the Applies To list.

Remarks

This string represents the coordinates used by the container of the control, such as "twips". This string can be used by the
control as a units indicator when displaying coordinate values.

If the container does not implement this ambient property, the default value will be an empty string.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa445670(v=vs.60).aspx 1/1
2. 1.2018 Scope Property (Visual Basic Add-In Model)

This documentation is archived and is not being maintained.

Visual Basic Extensibility Reference


Visual Studio 6.0

Scope Property
See Also Example Applies To

Returns whether a member is public, private, or friend.

Syntax

object.Scope

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

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263183(v=vs.60).aspx 1/1
2. 1.2018 Screen Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

Screen Property
See Also Example Applies To

Returns a Screen object, which enables you to manipulate forms according to their placement on the screen and control the
mouse pointer outside your application's forms at run time. The Screen object is accessed with the keyword Screen.

Syntax

Screen

Remarks

The Screen object is the entire Windows desktop. Using the Screen object, you can set the MousePointer property of the
Screen object to the hourglass pointer while a modal form is displayed.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445671(v=vs.60).aspx 1/1
2. 1.2018 Scroll Property

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


Visual Studio 6.0

Scroll Property
See Also Example Applies To

Returns or sets a value that specifies if scrollbars are displayed.

Syntax

object.Scroll [= boolean]

The Scroll property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

boolean A Boolean expression specifying if the object has scrollbars, as described in Settings.

Settings

The settings for boolean are:

Constant Description

False (Default) The object doesn't have scrollbars.

True The object has scrollbars.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa259681(v=vs.60).aspx 1/1
2. 1.2018 Scrollbars Property (DataRepeater Control) (DataRepeater Control)

This documentation is archived and is not being maintained.

Visual Basic: DataRepeater Control


Visual Studio 6.0

Scrollbars Property (DataRepeater Control)


See Also Example Applies To

Returns or sets a value that determines the scrollbar style.

Syntax

ob/ect. Scrollbars [= integer]

The Scrollbars property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

integer A numeric expression that determines the scrollbar appearance, as shown in Settings.

Settings

Constant Value Description

vbSBNone 0 None.

vbHoriz 1 Horizontal scrollbars only.

vbVert 2 (Default) Vertical scrollbars only.

vbBoth 3 Vertical and Horizontal scrollbars.

vbAuto 4 Scrollbars appear when needed.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa239317(v=vs.60).aspx 1/1
2. 1.2018 ScrollBars Property (MSHFlexGrid) (MSFlexGrid/MSHFlexGrid Controls)

This documentation is archived and is not being maintained.

Visual Basic: MSFlexGrid/MSHFlexGrid


Controls
Visual Studio 6.0

ScrollBars Property (MSHFlexGrid)


See Also Example Applies To

Returns or sets a value that determines whether an MSHFlexGrid has horizontal and/or vertical scroll bars.

Syntax

objectScrollBars [=value]

The ScrollBars property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

value An integer or constant that specifies the type of scroll bars, as described in Settings.

Settings

The settings for value are:

Constant Value Description

flexScrollNone 0 The MSHFlexGrid has no scroll bars.

flexScrollHorizontal 1 The MSHFlexGrid has a horizontal scroll bar.

flexScrollVertical 2 The MSHFlexGrid has a vertical scroll bar.

flexScrollBoth 3 The MSHFlexGrid has horizontal and vertical scroll bars. (Default)

Remarks

Scroll bars appear on an MSHFlexGrid only if its contents extend beyond its borders and value specifies scroll bars. If the
ScrollBars property is set to None, the MSHFlexGrid will not have scroll bars, regardless of its contents.

https://msdn.microsoft.com/en-us/library/aa261263(v=vs.60).aspx 1/2
2. 1.2018 ScrollBars Property (MSHFlexGrid) (MSFlexGrid/MSHFlexGrid Controls)

Note If the MSHFlexGrid has no scroll bars in either direction, it will not allow any scrolling in that direction, even if the
user uses the keyboard to select a cell that is beyond the visible area of the control.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa261263(v=vs.60).aspx 2/2
2. 1.2018 ScrollBars Property (RichTextBox Control)

This documentation is archived and is not being maintained.

Visual Basic: RichTextBox Control


Visual Studio 6.0

ScrollBars Property (RichTextBox Control)


See Also Example Applies To

Returns or sets a value indicating whether a RichTextBox control has horizontal or vertical scroll bars. Read-only at run time.

Syntax

object.ScrollBars

The object placeholder represents an object expression that evaluates to a RichTextBox control.

Settings

The ScrollBars property settings are:

Constant Value Description

rtfNone 0 (Default) No scroll bars shown.

rtfHorizontal 1 Horizontal scroll bar only.

rtfVertical 2 Vertical scroll bar only.

rtfBoth 3 Both horizontal and vertical scroll bars shown.

Remarks

For a RichTextBox control with setting 1 (Horizontal), 2 (Vertical), or 3 (Both), you must set the MultiLine property to True.

At run time, the Microsoft Windows operating environment automatically implements a standard keyboard interface to allow
navigation in RichTextBox controls with the arrow keys (UP ARROW, DOWN ARROW, LEFT ARROW, and RIGHT ARROW), the
HOME and END keys, and so on.

Scroll bars are displayed only if the contents of the RichTextBox extend beyond the control's borders. If ScrollBars is set to
False, the control won't have scroll bars, regardless of its contents.

A horizontal scrollbar will appear only when the RightMargin property is set to a value that is larger than the width of the
control. (The value can also be equal to, or slightly smaller than the width of the control.)

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa261671(v=vs.60).aspx 1/1
2. 1.2018 ScrollBars Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

ScrollBars Property
See Also Example Applies To

Returns or sets a value indicating whether an object has horizontal or vertical scroll bars. Read only at run time.

Syntax

object.ScrollBars

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

Settings

For an MDIForm object, the ScrollBars property settings are:

Setting Description

True (Default) The form has a horizontal or vertical scroll bar, or both.

False The form has no scroll bars.

For a TextBox control, the ScrollBars property settings are:

Constant Setting Description

vbSBNone 0 (Default) None

vbHorizontal 1 Horizontal

vbVertical 2 Vertical

vbBoth 3 Both

For a DataGrid control, the ScrollBars property settings are:

Constant Setting Description

https://msdn.microsoft.com/en-us/library/aa445672(v=vs.60).aspx 1/2
2. 1.2018 ScrollBars Property

dbgNone 0 (Default) None

dbgHorizontal 1 Horizontal

dbgVertical 2 Vertical

dbgBoth 3 Both

dbgAutomatic 4 Automatic

Remarks

For a TextBox control with setting 1 (Horizontal), 2 (Vertical), or 3 (Both), you must set the MultiLine property to True.

At run time, the Microsoft Windows operating environment automatically implements a standard keyboard interface to allow
navigation in TextBox controls with the arrow keys (UP ARROW, DOWN ARROW, LEFT ARROW, and RIGHT ARROW), the
HOME and END keys, and so on.

Scroll bars are displayed on an object only if its contents extend beyond the object's borders. For example, in an MDIForm
object, if part of a child form is hidden behind the border of the parent MDI form, a horizontal scroll bar (HScrollBar control)
is displayed. The exception to this is the TextBox control which will always display scroll bars. If ScrollBars is set to False, the
object won't have scroll bars, regardless of its contents.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445672(v=vs.60).aspx 2/2
2. 1.2018 ScrollBarSize Property (SysInfo Control)

This documentation is archived and is not being maintained.

Visual Basic: SysInfo Control


Visual Studio 6.0

ScrollBarSize Property
See Also Example Applies To

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

Syntax

ob/ect.ScroNBarSize

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

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa261142(v=vs.60).aspx 1/1
2. 1.2018 ScrollGroup Property (DataGrid Control)

This documentation is archived and is not being maintained.

Visual Basic: DataGrid Control


Visual Studio 6.0

ScrollGroup Property
See Also Example Applies To

Used to synchronize vertical scrolling between splits.

Syntax

ofa/ecf.ScrollGroup [= value]

The ScrollGroup property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

value An integer expression that determines the scroll group that a split belongs to.

Remarks

This property is used to synchronize vertical scrolling between splits. All splits with the same ScrollGroup setting will be
synchronized when vertical scrolling occurs within any one of them. Splits belonging to different groups can scroll
independently, allowing different splits to display different parts of the database.

If the ScrollBars property for a split is set to 4 - Automatic, only the rightmost split of the group will have a vertical scroll bar.
If there is only one split, setting this property has no effect.

Setting the FirstRow property for one split affects all other splits in the same group, keeping the group synchronized.

Newly created splits have a ScrollGroup value of 1.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa227383(v=vs.60).aspx 1/1
2. 1.2018 Scrolling Property

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


Visual Studio 6.0

Scrolling Property
See Also Example Applies To

Returns or sets a value that determines if the progress display appears solid or segmented.

Syntax

ob/ect. Scrolling [= integer]

The Scrolling property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

integer A numeric expression or constant specifying if the appearance of the progress display, as shown in Settings.

Settings

The settings for boolean are:

Constant Value Description

ccScrollingStandard 0 Standard, segmented scrolling.

ccScrollingSmooth 1 Scrolling appears smooth.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa259680(v=vs.60).aspx 1/1
2. 1.2018 ScrollRate Property (Windows Controls)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


Visual Studio 6.0

ScrollRate Property
See Also Example Applies To

Returns or sets a value that specifies the number of months that are scrolled when the user clicks one of the scroll buttons.

Syntax

ob/ect.ScroNRate [= number]

The ScrollRate 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 specifies the number of months that are scrolled at once.

Remarks

The ScrollRate property allows the user to scroll more than one month at a time.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa276549(v=vs.60).aspx 1/1
2. 1.2018 ScrollTrack Property (MSFlexGrid/MSHFlexGrid Controls)

This documentation is archived and is not being maintained.

Visual Basic: MSFlexGrid/MSHFlexGrid


Controls
Visual Studio 6.0

ScrollTrack Property
See Also Example Applies To

Returns or sets a value that determines whether the MSHFlexGrid should scroll its contents while the user moves the scroll
box along the scroll bars.

Syntax

object.ScrollTrack [=Boolean]

The ScrollTrack property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

Boolean A Boolean expression that specifies whether the MSHFlexGrid should scroll its contents when the user moves
the scroll box along the scroll bar.

Settings

The settings for Boolean are:

Part Description

True The MSHFlexGrid scrolls its contents while the user moves the scroll box along the scroll bar.

False The MSHFlexGrid content only changes once the scroll box is released. This is the default.

Remarks

Set this property to False to avoid excessive scrolling and flickering. Only set it to True to emulate other controls that have
this behavior or to view rows and columns as they are being scrolled.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa261264(v=vs.60).aspx 1/1
2. 1.2018 Second Property (Windows Controls)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


Visual Studio 6.0

Second Property
See Also Example Applies To

Sets or returns the integer representing the currently displayed second.

Syntax

object.Second [= integer]

The Second property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

integer An numeric expression between 0 and 59 that represents the seconds.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa276554(v=vs.60).aspx 1/1
2. 1.2018 SecondaryAxis Property

This documentation is archived and is not being maintained.

Visual Studio 6.0

Visual Basic: MSChart Control

SecondaryAxis Property
See Also Example Applies To

Returns or sets a value that determines whether the series is charted on the secondary axis.

Syntax

ob/ect.SecondaryAxis [ = boolean]

The SecondaryAxis property syntax has these parts:

P a rt D e s c rip tio n

o b ject An o b je ct expression th a t evaluates to an o b je ct in th e Applies To list.

boolean A Boolean expression th a t controls w h e th e r th e series is charted on th e secondary axis, as


described in S ettings.

Settings

The settings for boolean are:

S e ttin g D e s c rip tio n

T ru e The series is charted on th e secondary axis.

F a ls e (D e fa u lt) The series is not charted on th e secondary axis.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa229060(v=vs.60).aspx 1/1
2. 1.2018 Sections Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

Sections Property
See Also Example Applies To

Returns a reference to the Sections Collection.

Syntax

object.Sections

object.Sections(index)

The Sections property syntax has these parts:

Part Description

object Required. An object expression that evaluates to an object in the Applies To list.

index Optional. The index or name of a section.

Remarks

The property uses collection syntax to specify either the collection or a member of the collection to return.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445674(v=vs.60).aspx 1/1
2. 1.2018 Sections Collection Example

Visual Basic Reference


Sections Collection Example
The example prints the name of each Section object in the Data Report designer as well as the names of each control In the
section. To try the example, create a Data Report. Place a CommandButton control on a form, and paste the code into the
Declarations section of the code module. Press F5 to run the project and click the button.

Private Sub Command1_Click()


Dim sect, ctl
For Each sect In DataReport1.Sections
Debug.Print "Section", sect.Name
For Each ctl In sect.Controls
Debug.Print , ctl.Name
Next ctl
Next sect
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa231370(v=vs.60).aspx 1/1
2. 1.2018 SelAlignment Property (RichTextBox Control)

This documentation is archived and is not being maintained.

Visual Basic: RichTextBox Control


Visual Studio 6.0

SelAlignment Property
See Also Example Applies To

Returns or sets a value that controls the alignment of the paragraphs in a RichTextBox control. Not available at design time.

Syntax

ob/ect.SelAlignment [= value]

The SelAlignment property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

value An integer or constant that determines paragraph alignment, as described in Settings.

Settings

The settings for value are:

Constant Value Description

Null Neither. The current selection spans more than one paragraph with different alignments.

rtfLeft 0 (Default) Left. The paragraph is aligned along the left margin.

rtfRight 1 Right. The paragraph is aligned along the right margin.

rtfCenter 2 Center. The paragraph is centered between the left and right margins.

Remarks

The SelAlignment property determines paragraph alignment for all paragraphs that have text in the current selection or for
the paragraph containing the insertion point if no text is selected.

To distinguish between the values of Null and 0 when reading this property at run time, use the IsNull function with the
If...Then...Else statement. For example:

https://msdn.microsoft.com/en-us/library/aa261672(v=vs.60).aspx 1/2
2. 1.2018 SelAlignment Property (RichTextBox Control)

If IsNull(RichTextBox1.SelAlignment) = True Then


' Code to run when selection is mixed.
ElseIf RichTextBox1.SelAlignment = 0 Then
' Code to run when selection is left aligned.

End If

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa261672(v=vs.60).aspx 2/2
2. 1.2018 SelAlignment Property Example (RichTextBox Control)

Visual Basic: RichTextBox Control


SelAlignment Property Example
This example uses an array of OptionButton controls to change the paragraph alignment of selected text in a RichTextBox
control, but only if text is selected. The indices of the controls in the array correspond to settings for the SelAlignment
property. To try this example, put a RichTextBox control and three OptionButton controls on a form. Give all three of the
OptionButton controls the same name and set their Index property to 0, 1, and 2. Paste this code into the Click event of the
OptionButton control. Then run the example.

Private Sub Option1_Click(Index As Integer)


If RichTextBox1.SelLength > 0 Then
RichTextBox1.SelAlignment = Index
End If
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa261673(v=vs.60).aspx 1/1
2. 1.2018 SelBold, SelItalic, SelStrikethru, SelUnderline Properties (RichTextBox Control)

This documentation is archived and is not being maintained.

Visual Basic: RichTextBox Control


Visual Studio 6.0

SelBold, SelItalic, SelStrikethru, SelUnderline


Properties
See Also Example Applies To

Return or set font styles of the currently selected text in a RichTextBox control. The font styles include the following formats:
Bold, Italic, Strikethru, and Underline. Not available at design time.

Syntax

ofa/ect.SelBold [= value]

ofa/ect.SelItalic [= value]

ob/ectSelStrikethru [= value]

ob/ect.SelUnderline [= value]

The SelBold, SelItalic, SelStrikethru, and SelUnderline properties syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

value A Boolean expression or constant that determines the font style, as described in Settings.

Settings

The settings for value are:

Setting Description

Null Neither. The selection or character following the insertion point contains characters that have a mix of the
appropriate font styles.

True All the characters in the selection or character following the insertion point have the appropriate font style.

False (Default) None of the characters in the selection or character following the insertion point have the appropriate
font style.

https://msdn.microsoft.com/en-us/library/aa261674(v=vs.60).aspx 1/2
2. 1.2018 SelBold, SelItalic, SelStrikethru, SelUnderline Properties (RichTextBox Control)

Remarks

These properties behave like the Bold, Italic, Strikethru, and Underline properties of a Font object. The RichTextBox
control has a Font property and therefore the ability to apply font styles to all the text in the control through the properties
of the control's Font object. Use these properties to apply font styles to selected text or to characters entered at the insertion
point.

Typically, you access these properties by creating a toolbar in your application with buttons to toggle these properties
individually.

To distinguish between the values of Null and False when reading these properties at run time, use the IsNull function with
the If...Then...Else statement. For example:

If IsNull(RichTextBox1.SelBold) = True Then


' Code to run when selection is mixed.
ElseIf RichTextBox1.SelBold = False Then
' Code to run when selection is not bold.

End If

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa261674(v=vs.60).aspx 2/2
2. 1.2018 SelBookmarks Property (DataGrid Control)

This documentation is archived and is not being maintained.

Visual Basic: DataGrid Control


Visual Studio 6.0

SelBookmarks Property
See Also Example Applies To

Returns a collection of bookmarks for all selected records in the DataGrid control.

Syntax

ob/ect.SelBookmarks

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

Remarks

When a record is selected in the DataGrid control, its bookmark is appended to the collection returned by the
SelBookmarks property. For example, if you create a clone of the Recordset object created by the DataGrid control, you
can process individual data records by repositioning the cloned Recordset with bookmarks taken from the SelBookmarks
collection.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa260482(v=vs.60).aspx 1/1
2. 1.2018 SelBookmarks Property Example (DataGrid Control)

Visual Basic: DataGrid Control


SelBookmarks Property Example
This example loops through the rows the user has selected and deletes them from the database.

Sub DeleteRows()
Dim varBmk As Variant
For Each varBmk In DataGrid1.SelBookmarks
Data1.Recordset.Bookmark = varBmk
Data1.Recordset.Delete
Data1.Refresh
Next
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa260485(v=vs.60).aspx 1/1
2. 1.2018 SelBullet Property (RichTextBox Control)

This documentation is archived and is not being maintained.

Visual Basic: RichTextBox Control


Visual Studio 6.0

SelBullet Property
See Also Example Applies To

Returns or sets a value that determines if a paragraph in the RichTextBox control containing the current selection or
insertion point has the bullet style. Not available at design time.

Syntax

ob/ect.SelBullet [= value]

The SelBullet property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

Value An integer or constant that determines the bullet style of the paragraph(s), as described in Settings.

Settings

The settings for value are:

Setting Description

Null Neither. The selection spans more than one paragraph and contains a mixture of bullet and non-bullet styles.

True The paragraphs in the selection have the bullet style.

False (Default) The paragraphs in the selection don't have the bullet style.

Remarks

Use the SelBullet property to build a list of bulleted items in a RichTextBox control.

To distinguish between the values of Null and False when reading this property at run time, use the IsNull function with the
If...Then...Else statement. For example:

If IsNull(RichTextBoxl.SelBullet) = True Then


' Code to run when selection is mixed.
https://msdn.microsoft.com/en-us/Nbrary/aa240640(v=vs.60).aspx 1/2
2. 1.2018 SelBullet Property (RichTextBox Control)

ElseIf RichTextBox1.SelBullet = False Then


' Code to run when selection doesn't have bullet style.

End If

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa240640(v=vs.60).aspx 2/2
2. 1.2018 SelBullet Property Example (RichTextBox Control)

Visual Basic: RichTextBox Control


SelBullet Property Example
This example changes the state of a CheckBox control on a form to show the bullet status of selected text in a RichTextBox
control. To try this example, put a RichTextBox control and a CheckBox control on a form. Paste this code into the
SelChange event of the RichTextBox control. Then run the example.

Private Sub RichTextBox1_SelChange()


If IsNull(RichTextBox1.SelBullet) = True Then
Check1.Value = vbGrayed
ElseIf RichTextBox1.SelBullet = True Then
Check1.Value = vbChecked
ElseIf RichTextBox1.SelBullet = False Then
Check1.Value = vbUnchecked
End If
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa240642(v=vs.60).aspx 1/1
2. 1.2018 SelColor Property (RichTextBox Control)

This documentation is archived and is not being maintained.

Visual Basic: RichTextBox Control


Visual Studio 6.0

SelColor Property
See Also Example Applies To

Returns or sets a value that determines the color of text in the RichTextBox control. Not available at design time.

Syntax

object.SelColor [= color]

The SelColor property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

color A value that specifies a color, as described in Settings.

Settings

The settings for color are:

Setting Description

Null The text contains a mixture of different color settings.

RGB Colors specified in code with the RGB or QBColor functions.


colors

System Colors specified with the system color constants in the Visual Basic object library in the Object Browser. The
color of the text then matches user selections for the specified constant in the Windows Control Panel.

Remarks

If there is no text selected in the RichTextBox control, setting this property determines the color of all new text entered at
the current insertion point.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa240626(v=vs.60).aspx 1/1
2. 1.2018 SelColor Property Example (RichTextBox Control)

Visual Basic: RichTextBox Control


SelColor Property Example
This example displays a color dialog box from a CommonDialog control to specify the color of selected text in a
RichTextBox control. To try this example, put a RichTextBox control, a CommandButton control, and a CommonDialog
control on a form. Paste this code into the Click event of the CommandButton control. Then run the example.

Private Sub Command1_Click()


CommonDialogl.ShowColor
RichTextBoxl.SelColor = CommonDialogl.Color
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa240633(v=vs.60).aspx 1/1
2. 1.2018 SelCount Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

SelCount Property
See Also Example Applies To

Returns the number of selected items in a ListBox control.

Syntax

ob/ect.SelCount

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

Remarks

The SelCount property returns 0 if no items are selected. Otherwise, it returns the number of list items currently selected.
This property is particularly useful when users can make multiple selections.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445675(v=vs.60).aspx 1/1
2. 1.2018 Selected Property (ActiveX Controls)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


Visual Studio 6.0

Selected Property (ActiveX Controls)


See Also Example Applies To

Returns or sets a value that determines if an object is selected. For a ListItem object, the Selected property does not set the
SelectedItem property, and thus does not cause the object to be selected. It only returns a value indicating whether the
ListItem object has already been selected by other means.

Syntax

o b j e c t .Selected [ = boolean]

The Selected property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

boolean A Boolean expression that determines if an object is selected.

Remarks

Use the Selected property to programmatically select a specific Node or Tab object. Once you have selected an object in
this manner, you can perform various operations on it, such as setting properties and invoking methods.

To select a specific Node object, you must refer to it by the value of either its Index property or its Key property. The
following example selects a specific Node object in a TreeView control:

Private Sub Command1_Click()


TreeView1.Nodes(3).Selected = True ' Selects an object.
' Use the SelectedItem property to get a reference to the object.
TreeView1.SelectedItem.Text = "Changed Text"
End Sub

In the ListView control, the SelectedItem property always refers to the first selected item. Therefore, if multiple items are
selected, you must iterate through all of the items, checking each item's Selected property.

Note Instead of using the Selected property to programmatically select a ListItem object, use the Set statement with the
SelectedItem property, as follows:

Set ListView1.SelectedItem = ListView1.ListItems(1)

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259685(v=vs.60).aspx 1/1
2. 1.2018 Selected Property Example

Visual Basic: Windows Controls


Selected Property Example
This example adds several Node objects to a TreeView control. When a Node is selected, a reference to the selected Node
is used to display its key. To try the example, place a TreeView control on a form, and paste the code into the form's
Declarations section. Run the example, select a Node, and click the form.

Private Sub Form_Load()


Dim nodX As Node ' Create a tree.
Set nodX = TreeViewl.Nodes.Add^/'r'VRoot'')
Set nodX = TreeViewl.Nodes.Add^/'p'VParent'')
Set nodX = TreeView1.Nodes.Add(,,p,,,tvwChildj/,Child 1")
nodX.EnsureVisible ' Show all nodes.
Set nodX = TreeView1.Nodes.Add(,,r,,,tvwChild/,C2,V C h i l d 2")
Set nodX = TreeView1.Nodes.Add(,,C2,,jtvwChild/,C3'VChild 3'')
Set nodX = TreeView1.Nodes.Add(,,C3,,JtvwChildJ/'Child 4'')
Set nodX = TreeView1.Nodes.Add(,,C3,,JtvwChildJ/'Child 5')
nodX.EnsureVisible ' Show all nodes.
End Sub

Private Sub Form_Click()


Dim intX As Integer
On Error Resume Next ' If an integer isn't entered.
intX = InputBox(''Check Node''jjTreeView1.SelectedItem.Index)
If IsNumeric(intX) Then ' Ensure an integer was entered.
If TreeViewl.Nodes(intX).Selected = True Then
MsgBox TreeView1.Nodes(intX).Text & ' is selected.'
Else
MsgBox 'Not selected'
End If
End If
End Sub

The following example adds three ListItem objects to a ListView control. When you click the form, the code uses the
Selected property to determine if a specific ListItem object is selected. To try the example, place a ListView control on a
form and paste the code into the form's Declarations section. Run the example, select a ListItem, and click the form.

Private Sub Form_Load()


Listviewl.BorderStyle = vbFixedSingle ' Show the border.
Dim itmX As ListViewItem
Set itmX = ListViewl.ListItems.Add^/'Item 1')
Set itmX = ListViewl.ListItems.Add^/'Item 2')
Set itmX = ListViewl.ListItems.Add^/'Item 3')
End Sub

Private Sub Form_Click()


Dim intX As Integer
On Error Resume Next ' If an integer isn't entered.
intX = InputBox(''Check Item', , Listviewl.SelectedItem.Index)
If IsNumeric(intX) Then ' Ensure an integer was entered.
If ListViewl.ListItems(intX).Selected = True Then
MsgBox ListView1.ListItems(intX).Text & ' is selected.'
Else

https://msdn.microsoft.com/en-us/library/aa259686(v=vs.60).aspx 1/2
2. 1.2018 Selected Property Example

MsgBox "Not selected


End If
End If
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259686(v=vs.60).aspx 2/2
2. 1.2018 Selected Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

Selected Property
See Also Example Applies To

Returns or sets the selection status of an item in a FileListBox or ListBox control. This property is an array of Boolean values
with the same number of items as the List property. Not available at design time.

Syntax

object.Selected(index) [= boolean]

The Selected property syntax has these parts:

Part Description

Object An object expression that evaluates to an object in the Applies To list.

Index The index number of the item in the control.

Boolean A Boolean expression specifying whether the item is selected, as described in Settings.

Settings

The settings for boolean are:

Setting Description

True The item is selected.

False (Default) The item isn't selected.

Remarks

This property is particularly useful when users can make multiple selections. You can quickly check which items in a list are
selected. You can also use this property to select or deselect items in a list from code.

If the MultiSelect property is set to 0, you can use the ListIndex property to get the index of the selected item. However, in
a multiple selection, the ListIndex property returns the index of the item contained within the focus rectangle, whether or
not the item is actually selected.

https://msdn.microsoft.com/en-us/Nbrary/aa445676(v=vs.60).aspx 1/2
2. 1.2018 Selected Property

If a ListBox controls Style property is set to 1 (check boxes), the Selected property returns True only for those items whose
check boxes are selected. The Selected property will not return True for those items which are only highlighted.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445676(v=vs.60).aspx 2/2
2. 1.2018 SelectedControls Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

SelectedControls Property
See Also Example Applies To

Returns a collection that contains all the currently selected controls on the form. The SelectedControls property is not
available at the property pages authoring time, and read-only at the property pages run time.

Syntax

ob/ect.SelectedControls

The SelectedControls property syntax has this part:

Part Description

object An object expression that evaluates to an object in the Applies To list.

Remarks

This collection is useful to a property page in determining which controls are currently selected, and therefore which controls
might need properties changed. Some containers only allow one control to be selected at once; in that case
SelectedControls will only contain one control. Other containers allow more than one control to be selected at once; in that
case there may be more than one control selected, and the property page must iterate through the controls in the
SelectedControls collection and attempt to set the changed properties. Suitable error handling should be written to take care
of the cases when a particular control in the collection does not have the changed property, or when the control raises an
error when the property is set.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445677(v=vs.60).aspx 1/1
2. 1.2018 SelectedImage Property

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


Visual Studio 6.0

SelectedImage Property
See Also Example Applies To

Returns or sets the index or key value of a ListImage object in an associated ImageList control; the ListImage is displayed
when a Node object is selected.

Syntax

o b j e c t .SelectedImage [ = index]

The SelectedImage property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

index An integer or unique string that identifies a ListImage object in an associated ImageList control. The integer is
the value of the ListImage object's Index property; the string is the value of the Key property.

Remarks

If this property is set to Null, the mask of the default image specified by the Image property is used.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259682(v=vs.60).aspx 1/1
2. 1.2018 SelectedItem Property (ActiveX Controls)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


Visual Studio 6.0

SelectedItem Property (ActiveX Controls)


See Also Example Applies To

Returns a reference to a selected ListItem, Node, or Tab object.

Syntax

o b j e c t .SelectedItem

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

Remarks

The SelectedItem property returns a reference to an object that can be used to set properties and invoke methods on the
selected object. This property is typically used to return a reference to a ListItem, Node, or Tab or object that the user has
clicked or selected. With this reference, you can validate an object before allowing any further action, as demonstrated in the
following code:

Command1_Click()
' If the selected object is not the root, then remove the Node.
If TreeView1.SelectedItem.Index <> 1 Then
Treeview1.Nodes.Remove TreeView1.SelectedItem.Index
End If
End Sub

To programmatically select a ListItem object, use the Set statement with the SelectedItem property, as follows:

Set ListView1.SelectedItem = ListView1.ListItems(1)

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259683(v=vs.60).aspx 1/1
2. 1.2018 SelectedItem Property Example

Visual Basic: Windows Controls


SelectedItem Property Example
This example adds several Node objects to a TreeView control. After you select a Node, click the form to see various
properties of the Node. To try the example, place a TreeView control on a form and paste the code into the form's
Declarations section. Run the example, select a Node, and click the form.

Private Sub Form_Load()


Dim nodX As Node
Set nodX = TreeView1.Nodes.Add(, , "r", "Root")
Set nodX = TreeView1.Nodes.Add("r"j tvwChild, "c1", "Child 1")
Set nodX = TreeView1.Nodes.Add("r", tvwChild, "c2", "Child 2")
Set nodX = TreeView1.Nodes.Add("r", tvwChild, "c3", "Child 3")
Set nodX = TreeView1.Nodes.Add("c3", tvwChild, "c4", "Child 4")
Set nodX = TreeView1.Nodes.Add("c3", tvwChild, "c5", "Child 5")
Set nodX = TreeView1.Nodes.Add("c5", tvwChild, "c6", "Child 6")
Set nodX = TreeView1.Nodes.Add("c5", tvwChild, "c7", "Child 7")
nodX.EnsureVisible
TreeView1.BorderStyle = vbFixedSingle
End Sub

Private Sub Form_Click()


Dim nodX As Node
' Set the variable to the SelectedItem.
Set nodX = TreeView1.SelectedItem
Dim strProps As String
' Retrieve properties of the node.
strProps = "Text: " & nodX.Text & vbLF
strProps = strProps & "Key: " & nodX.Key & vbLF
On Error Resume Next ' Root node doesn't have a parent.
strProps = strProps & "Parent: " & nodX.Parent.Text & vbLF
strProps = strProps & "FirstSibling: " & _
nodX.FirstSibling.Text & vbLF
strProps = strProps & "LastSibling: " & _
nodX.LastSibling.Text & vbLF
strProps = strProps & "Next: " & nodX.Next.Text & vbLF

MsgBox strProps
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259684(v=vs.60).aspx 1/1
2. 1.2018 SelectedItem Property (DataCombo Control)

This documentation is archived and is not being maintained.

Visual Basic: DataCombo/DataList Controls


Visual Studio 6.0

SelectedItem Property
See Also Example Applies To

Returns a value containing a bookmark for the selected record in a DataCombo or DataList control.

Syntax

ob/ect.SelectedItem

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

Remarks

When you select an item in the list portion of the control, the SelectedItem property contains a bookmark that you can use
to reposition to the selected record in the Recordset of the Data control specified by the RowSource property.

Data Type

Variant

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa260133(v=vs.60).aspx 1/1
2. 1.2018 SelectedVBComponent Property (VBA Add-In Object Model) (Visual Basic Add-In Model)

This documentation is archived and is not being maintained.

Visual Basic Extensibility Reference


Visual Studio 6.0

SelectedVBComponent Property
See Also Example Applies To Specifics

Returns the selected component. Read-only.

Remarks

The SelectedVBComponent property returns the selected component in the Project window. If the selected item in the
Project window isn't a component, SelectedVBComponent returns Nothing.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445226(v=vs.60).aspx 1/1
2. 1.2018 SelectedVBComponent Property Example (Visual Basic Add-In Model)

Visual Basic Extensibility Reference


SelectedVBComponent Property Example
The following example uses the SelectedVBComponent property to return the selected component.

Debug.Print Application.VBE.SelectedVBComponent.Name

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445228(v=vs.60).aspx 1/1
2. 1.2018 SelectedVBControls Property (Visual Basic Add-In Model)

This documentation is archived and is not being maintained.

Visual Basic Extensibility Reference


Visual Studio 6.0

SelectedVBControls Property
See Also Example Applies To

Returns a collection of selected controls on a form.

Syntax

ob/ect.SelectedVBControls

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

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263185(v=vs.60).aspx 1/1
2. 1.2018 SelectedVBControlsEvents Property (Visual Basic Add-In Model)

This documentation is archived and is not being maintained.

Visual Basic Extensibility Reference


Visual Studio 6.0

SelectedVBControlsEvents Property
See Also Example Applies To

Returns all events supported by the controls currently selected on a form.

Syntax

ob/ect.SelectedVBControlsEvents (vbproject As Variant)

The SelectedVBControlsEvents property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

vbproject A variant expression specifying the project which contains the form and controls.

Remarks

Returns an event object of type SelectedVBControlsEvents. This event is sourced from a VBForm.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263184(v=vs.60).aspx 1/1
2. 1.2018 SelectionMode Property (MSFlexGrid/MSHFlexGrid Controls)

This documentation is archived and is not being maintained.

Visual Basic: MSFlexGrid/MSHFlexGrid


Controls
Visual Studio 6.0

SelectionMode Property
See Also Example Applies To

Returns or sets a value that determines whether an MSHFlexGrid should allow regular cell selection, selection by rows, or
selection by columns.

Syntax

ob/ect.SelectionMode [=value]

The SelectionMode property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

value An integer or constant that specifies the selection mode, as described in Settings.

Settings

The settings for value are:

Constant Value Description

flexSelectionFree 0 Free. This allows individual cells in the MSHFlexGrid to be selected, spreadsheet
style. This is the default.

flexSelectionByRow 1 By Row. This forces selections to span entire rows, as in a multi-column list box or
record-based display.

flexSelectionByColumn 2 By Column. This forces selections to span entire columns, as if selecting ranges for a
chart or fields for sorting.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa261265(v=vs.60).aspx 1/1
2. 1.2018 SelectRange Property

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


Visual Studio 6.0

SelectRange Property
See Also Example Applies To

Sets a value that determines if a Slider control can have a selected range.

Syntax

ob/ect.SelectRange = boolean

The SelectRange property syntax has these parts:

Part Description

object An object expression that evaluates to a Slider control.

boolean A Boolean expression that determines whether or not the Slider can have a selected range, as described in
Settings.

Settings

The settings for boolean are:

Setting Description

True The Slider can have a selected range.

False The Slider can't have a selected range.

Remarks

If SelectRange is set to False, then the SelStart property setting is the same as the Value property setting. Setting the
SelStart property also changes the Value property, and vice-versa, which will be reflected in the position of the slider on the
control. Setting SelLength when the SelectRange property is False has no effect.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259687(v=vs.60).aspx 1/1
2. 1.2018 SelectRange Property Example

Visual Basic: Windows Controls


SelectRange Property Example
This example allows the user to select a range when the SHIFT key is held down. To try the example, place a Slider control on
a form and paste the code into the form's Declarations section. Run the example and select a range by holding down the
SHIFT key and dragging or clicking the mouse on the Slider control.

Private Sub Form_Load()


'Set slider control settings
Slider1.Max = 20
End Sub

Private Sub Slider1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)


If Shift = 1 Then ' If Shift button is down then
Slider1.SelectRange = True ' turn SelectRange on.
Slider1.SelStart = Slider1.Value ' Set the SelStart value
Slider1.SelLength = 0 ' Set previous SelLength (if any) to 0.
End If
End Sub

Private Sub Slider1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)

If Shift = 1 Then
' If user selects backwards from a point, an error will occur.
On Error Resume Next
' Else set SelLength using SelStart and current value.
Slider1.SelLength = Slider1.Value - Slider1.SelStart
Else
Slider1.SelectRange = False ' If user lifts SHIFT key.
End If
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259688(v=vs.60).aspx 1/1
2. 1.2018 SelEndCol, SelStartCol Properties

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

SelEndCol, SelStartCol Properties


See Also Example Applies To

Return or set the first or last column for a range of cells. Not available at design time.

• SelEndCol the last selected column on the right.

• SelStartCol the first selected column on the left.

Syntax

ob/ect.SelEndCol [= value ]

object.SelStartCol [= value]

The SelEndCol and SelStartCol property syntaxes have these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

value A numeric expression specifying the first or last column or row.

Remarks

You can use these properties to select a specific region of a DataGrid control from code or to return in code the dimensions
of an area that the user selects.

SelStartCol specifies the cell in the upper-left corner of a selected range. SelEndCol specifies the cell in the lower-right
corner of a selected range.

To specify a cell without moving the current selection, use the Col and Row properties.

The default value for SelStartCol and SelEndCol is -1.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445678(v=vs.60).aspx 1/1
2. 1.2018 SelFontName Property (RichTextBox Control)

This documentation is archived and is not being maintained.

Visual Basic: RichTextBox Control


Visual Studio 6.0

SelFontName Property
See Also Example Applies To

Returns or sets the font used to display the currently selected text or the character(s) immediately following the insertion
point in the RichTextBox control. Not available at design time.

Syntax

ob/ect.SelFontName [= string]

The SelFontName property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

string A string expression that identifies a font installed on the system.

Remarks

The SelFontName property returns Null if the selected text contains different fonts.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa240634(v=vs.60).aspx 1/1
2. 1.2018 SelFontName Property Example (RichTextBox Control)

Visual Basic: RichTextBox Control


SelFontName Property Example
This example displays a font dialog box from a CommonDialog control to specify font attributes of selected text in a
RichTextBox control. To try this example, put a RichTextBox control, a CommandButton control, and a CommonDialog
control on a form. Paste this code into the Click event of the CommandButton control. Then run the example.

Private Sub Command1_Click ()


CommonDialogl.Flags = cdlCFBoth
CommonDialogl.ShowFont
With RichTextBoxl
.SelFontName = CommonDialogl.FontName
.SelFontSize = CommonDialogl.FontSize
.SelBold = CommonDialog1.FontBold
.SelItalic = CommonDialog1.FontItalic
.SelStrikethru = CommonDialog1.FontStrikethru
.SelUnderline = CommonDialog1.FontUnderline
End With
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa240635(v=vs.60).aspx 1/1
2. 1.2018 SelFontSize Property (RichTextBox Control)

This documentation is archived and is not being maintained.

Visual Basic: RichTextBox Control


Visual Studio 6.0

SelFontSize Property
See Also Example Applies To

Returns or sets a value that specifies the size of the font used to display text in a RichTextBox control. Not available at
design time.

Syntax

ob/ect.SelFontSize [= points]

The SelFontSize property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

points An integer that specifies the size in points of the currently selected text or the characters immediately following
the insertion point.

Remarks

The maximum value for SelFontSize is 2160 points.

In general, you should change the SelFontName property before you set the size and style attributes. However, when you
set TrueType fonts to smaller than 8 points, you should set the point size to 3 with the SelFontSize property, then set the
SelFontName property, and then set the size again with the SelFontSize property.

Note Available fonts depend on your system configuration, display devices, and printing devices, and therefore may vary
from system to system.

The SelFontSize property returns Null if the selected text contains different font sizes.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa240636(v=vs.60).aspx 1/1
2. 1.2018 SelFontSize Property Example (RichTextBox Control)

Visual Basic: RichTextBox Control


SelFontSize Property Example
This example displays a font dialog box from a CommonDialog control to specify font attributes of selected text in a
RichTextBox control. To try this example, put a RichTextBox control, a CommandButton control, and a CommonDialog
control on a form. Paste this code into the Click event of the CommandButton control. Then run the example.

Private Sub Command1_Click ()


CommonDialogl.Flags = Both
CommonDialogl.ShowFont
With RichTextBoxl
.SelFontName = CommonDialogl.FontName
.SelFontSize = CommonDialog1.FontSize
.SelBold = CommonDialog1.FontBold
.SelItalic = CommonDialog1.FontItalic
.SelStrikethru = CommonDialog1.FontStrikethru
.SelUnderline = CommonDialog1.FontUnderline
End With
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa240637(v=vs.60).aspx 1/1
2. 1.2018 SelHangingIndent, SelIndent, SelRightIndent Properties (RichTextBox Control)

This documentation is archived and is not being maintained.

Visual Basic: RichTextBox Control


Visual Studio 6.0

SelHangingIndent, SelIndent, SelRightIndent


Properties
See Also Example Applies To

Returns or sets the margin settings for the paragraph(s) in a RichTextBox control that either contain the current selection or
are added at the current insertion point. Not available at design time.

Syntax

ob/ect.SelHangingIndent [= integer]

ob/ect.SelIndent [= integer]

ob/ect.SelRightIndent [= integer]

The SelHangingIndent, SelIndent, and SelRightIndent properties syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

integer An integer that determines the amount of indent. These properties use the scale mode units of the Form object
containing the RichTextBox control.

Remarks

For the affected paragraph(s), the SelIndent property specifies the distance between the left edge of the RichTextBox
control and the left edge of the text that is selected or added. Similarly, the SelRightIndent property specifies the distance
between the right edge of the RichTextBox control and the right edge of the text that is selected or added.

The SelHangingIndent property specifies the distance between the left edge of the first line of text in the selected
paragraph(s) (as specified by the SelIndent property) and the left edge of subsequent lines of text in the same paragraph(s).

These properties return zero (0) if the selection spans multiple paragraphs with different margin settings.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa240638(v=vs.60).aspx 1/1
2. 1.2018 SelHangingIndent, SelIndent, SelRIghtIndent Properties Example (RichTextBox Control)

Visual Basic: RichTextBox Control


SelHangingIndent, SelIndent, SelRIghtIndent
Properties Example
This example selects all the text In a RichTextBox control, then sets both the left and right Indents to create margins. To try
this example, put a RichTextBox control, a CommandButton control, and a TextBox control on a form. Load a file into the
RichTextBox, and paste this code into the General Declarations section of the form. Then run the example.

Private Sub Command1_Click()


Dim Margins As Integer
Margins = CInt(Text1.Text)
With RichTextBox1
.SelStart = 1
.SelLength = Len(RichTextBox1.Text)
.SelIndent = Margins
.SelRightIndent = Margins
End With
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa240639(v=vs.60).aspx 1/1
2. 1.2018 SelCharOffset Property (RichTextBox Control)

This documentation is archived and is not being maintained.

Visual Basic: RichTextBox Control


Visual Studio 6.0

SelCharOffset Property
See Also Example Applies To

Returns or sets a value that determines whether text in the RichTextBox control appears on the baseline (normal), as a
superscript above the baseline, or as a subscript below the baseline. Not available at design time.

Syntax

object.SelCharOffset [= offset]

The SelCharOffset property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

offset An integer that determines how far the characters in the current selection or that following the insertion point
are offset from the baseline of the text, as described in Settings.

Settings

The settings for offset are:

Setting Description

Null Neither. The selection has a mix of characters with different offsets.

0 (Default) Normal. The characters all appear on the normal text baseline.

Positive integer Superscript. The characters appear above the baseline by the number of twips specified.

Negative integer Subscript. The characters appear below the baseline by the number of twips specified.

Remarks

To distinguish between the values of Null and 0 when reading this property at run time, use the IsNull function with the
If...Then...Else statement. For example:

https://msdn.microsoft.com/en-us/Nbrary/aa261675(v=vs.60).aspx 1/2
2. 1.2018 SelCharOffset Property (RichTextBox Control)

If IsNull(RichTextBox1.SelCharOffset) = True Then


' Code to run when selection is mixed.
ElseIf RichTextBox1.SelCharOffset = 0 Then
' Code to run when selection is all on the baseline.

End If

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa261675(v=vs.60).aspx 2/2
2. 1.2018 SelCharOffset Property Example (RichTextBox Control)

Visual Basic: RichTextBox Control


SelCharOffset Property Example
This example uses a scroll bar to move selected text above or below the baseline. The minimum and maximum amount of
offset is established by the font size of the text within the RichTextBox control. To try this example, put a RichTextBox
control and a VScrollBar control on a form. Paste this code into the Change event of the VScrollBar control. Then run the
example.

Private Sub VScroll1_Change ()


VScrolll.Max = RichTextBoxl.SelFontSize
VScrolll.Min = -(VScrolll.Max)
RichTextBoxl.SelCharOffset = VScroll1.Value
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa261721(v=vs.60).aspx 1/1
2. 1.2018 SelImage Property

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


Visual Studio 6.0

SelImage Property
See Also Example Applies To

Index or key into the ImageList control where the selected image for this item can be found.

Syntax

ob/ect.SelImage [= variant]

The SelImage property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

variant A variant expression that evaluates to the index or the key value of an image in the ImageList control.

Remarks

The SelImage property specifies the picture that will be displayed when an item is selected from the list. It also determines
which picture will appear next to the item in the text box portion of the combo box. If you do not specify a value for the
SelImage property, the item's picture will not change when the item is selected.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259689(v=vs.60).aspx 1/1
2. 1.2018 SelLength, SelStart Properties (Slider Control)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


Visual Studio 6.0

SelLength, SelStart Properties (Slider Control)


See Also Example Applies To

• SelLength returns or sets the length of a selected range in a Slider control.

• SelStart returns or sets the start of a selected range in a Slider control.

Syntax

ob/ect.SelLength [= value]

ob/ect.SelStart [= value]

The SelLength and SelStart property syntaxes have these parts:

Part Description

object An object expression that evaluates to a Slider control.

value A value that falls within the Min and Max properties.

Remarks

The SelLength and SelStart properties are used together to select a range of contiguous values on a Slider control. The
Slider control then has the additional advantage of being a visual analog of the range of possible values.

The SelLength property can't be less than 0, and the sum of SelLength and SelStart can't be greater than the M ax property.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259690(v=vs.60).aspx 1/1
2. 1.2018 SelLength, SelStart Properties Example

Visual Basic: Windows Controls


SelLength, SelStart Properties Example
This example selects a range on a Slider control. To try this example, place a Slider control onto a form with three TextBox
controls, named Text1, Text2, and Text3. The Slider control's SelectRange property must be set to True. Paste the code
below into the form's Declarations section, and run the example. While holding down the SHIFT key, you can select a range
on the slider, and the various values will be displayed in the text boxes.

Private Sub Form_Load()


' Make sure SelectRange is True so selection can occur.
Slider1.SelectRange = True
End Sub

Private Sub Slider1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)


If Shift = 1 Then ' If SHIFT is down, begin the range selection.
Slider1.ClearSel ' Clear any previous selection.
Slider1.SelStart = Slider1.Value
Text2.Text = Slider1.SelStart ' Show the beginning
' of the range in the textbox.
Else
Slider1.ClearSel ' Clear any previous selection.
End If
End Sub

Private Sub Slider1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)


' When SHIFT is down and SelectRange is True,
' this event is triggered.
If Shift = 1 And Slider1.SelectRange = True Then
' Make sure the current value is larger than SelStart or
' an error will occur--SelLength can't be negative.
If Slider1.Value >= Slider1.SelStart Then
Slider1.SelLength = Slider1.Value - Slider1.SelStart
Text1.Text = Slider1.Value ' To see the end of the range.
' Text3 is the difference between the end and start values.
Text3.Text = Slider1.SelLength
End If
End If
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259691(v=vs.60).aspx 1/1
2. 1.2018 SelLength, SelStart, SelText Properties (ActiveX Controls) (Appearance Property (ActiveX Controls))

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

SelLength, SelStart, SelText Properties


(ActiveX Controls)
See Also Example Applies To

• SelLength returns or sets the number of characters selected.

• SelStart returns or sets the starting point of text selected; indicates the position of the insertion point if no text is
selected.

• SelText returns or sets the string containing the currently selected text; consists of a zero-length string ("") if no
characters are selected.

These properties aren't available at design time.

Syntax

object.SelLength [= number]

object.SelStart [= index]

object.SelText [= value]

The SelLength, SelStart, and SelText property syntaxes have these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

number A numeric expression specifying the number of characters selected. For SelLength and SelStart, the valid
range of settings is 0 to text length the total number of characters in the edit area of a ComboBox or TextBox
control.

index A numeric expression specifying the starting point of the selected text, as described in Settings.

value A string expression containing the selected text.

Remarks

Use these properties for tasks such as setting the insertion point, establishing an insertion range, selecting substrings in a
control, or clearing text. Used in conjunction with the Clipboard object, these properties are useful for copy, cut, and paste
operations.

https://msdn.microsoft.com/en-us/Nbrary/aa443239(v=vs.60).aspx 1/2
2. 1.2018 SelLength, SelStart, SelText Properties (ActiveX Controls) (Appearance Property (ActiveX Controls))

When working with these properties:

• Setting SelLength less than 0 causes a run-time error.

• Setting SelStart greater than the text length sets the property to the existing text length; changing SelStart changes
the selection to an insertion point and sets SelLength to 0.

• Setting SelText to a new value sets SelLength to 0 and replaces the selected text with the new string.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa443239(v=vs.60).aspx 2/2
2. 1.2018 SelLength, SelStart, SelText Properties Example

Visual Basic Reference


SelLength, SelStart, SelText Properties
Example
This example enables the user to specify some text to search for and then searches for the text and selects it, if found. To try
this example, paste the code into the Declarations section of a form that contains a wide TextBox control, and then press F5
and click the form.

Private Sub Form_Load ()


Text1.Text = "Two of the peak human experiences"
Text1.Text = Text1.Text & " are good food and classical music.'
End Sub
Private Sub Form_Click ()
Dim Search, Where ' Declare variables.
' Get search string from user.
Search = InputBox("Enter text to be found:")
Where = InStr(Text1.Text, Search) ' Find string in text.
If Where Then ' If found,
Text1.SetFocus
Text1.SelStart = Where - 1 ' set selection start and
Text1.SelLength = Len(Search) ' set selection length.
Else
MsgBox "String not found." ' Notify user.
End If
End Sub

This example shows how the Clipboard object is used in cut, copy, paste, and delete operations. To try this example, create a
form with a TextBox control and use the Menu Editor to create an Edit menu (for each of the commands, set the Caption
property = Cut, Copy, Paste, and Delete, respectively; set the Name property = EditCut, EditCopy, EditPaste, and EditDelete,
respectively).

Private Sub EditCut_Click ()


' Clear the contents of the Clipboard.
Clipboard.Clear
' Copy selected text to Clipboard.
ClipBoard.SetText Screen.ActiveControl.SelText
' Delete selected text.
Screen.ActiveControl.SelText = ""
End Sub

Private Sub EditCopy_Click ()


' Clear the contents of the Clipboard.
Clipboard.Clear
' Copy selected text to Clipboard.
ClipBoard.SetText Screen.ActiveControl.SelText
End Sub

Private Sub EditPaste_Click ()


' Place text from Clipboard into active control.
Screen.ActiveControl.SelText = ClipBoard.GetText ()
End Sub

https://msdn.microsoft.com/en-us/library/aa445680(v=vs.60).aspx 1/2
2. 1.2018 SelLength, SelStart, SelText Properties Example

Private Sub EditDelete_Click ()


' Delete selected text.
Screen.ActiveControl.SelText =
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445680(v=vs.60).aspx 2/2
2. 1.2018 SelLength, SelStart, SelText Properties

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

SelLength, SelStart, SelText Properties


See Also Example Applies To

• SelLength returns or sets the number of characters selected.

• SelStart returns or sets the starting point of text selected; indicates the position of the insertion point if no text is
selected.

• SelText returns or sets the string containing the currently selected text; consists of a zero-length string ("") if no
characters are selected.

These properties aren't available at design time.

Syntax

object.SelLength [= number]

object.SelStart [= index]

object.SelText [= value]

The SelLength, SelStart, and SelText property syntaxes have these parts:

Part Description

Object An object expression that evaluates to an object in the Applies To list.

Number A numeric expression specifying the number of characters selected. For SelLength and SelStart, the valid
range of settings is 0 to text length the total number of characters in the edit area of a ComboBox or TextBox
control.

Index A numeric expression specifying the starting point of the selected text, as described in Settings.

Value A string expression containing the selected text.

Remarks

Use these properties for tasks such as setting the insertion point, establishing an insertion range, selecting substrings in a
control, or clearing text. Used in conjunction with the Clipboard object, these properties are useful for copy, cut, and paste
operations.

When working with these properties:

https://msdn.microsoft.com/en-us/library/aa445679(v=vs.60).aspx 1/2
2. 1.2018 SelLength, SelStart, SelText Properties

• Setting SelLength less than 0 causes a run-time error.

• Setting SelStart greater than the text length sets the property to the existing text length; changing SelStart changes
the selection to an insertion point and sets SelLength to 0.

• Setting SelText to a new value sets SelLength to 0 and replaces the selected text with the new string.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445679(v=vs.60).aspx 2/2
2. 1.2018 SelLength, SelStart, SelText Properties Example

Visual Basic Reference


SelLength, SelStart, SelText Properties
Example
This example enables the user to specify some text to search for and then searches for the text and selects it, if found. To try
this example, paste the code into the Declarations section of a form that contains a wide TextBox control, and then press F5
and click the form.

Private Sub Form_Load ()


Text1.Text = "Two of the peak human experiences"
Text1.Text = Text1.Text & " are good food and classical music.'
End Sub
Private Sub Form_Click ()
Dim Search, Where ' Declare variables.
' Get search string from user.
Search = InputBox("Enter text to be found:")
Where = InStr(Text1.Text, Search) ' Find string in text.
If Where Then ' If found,
Text1.SetFocus
Text1.SelStart = Where - 1 ' set selection start and
Text1.SelLength = Len(Search) ' set selection length.
Else
MsgBox "String not found." ' Notify user.
End If
End Sub

This example shows how the Clipboard object is used in cut, copy, paste, and delete operations. To try this example, create a
form with a TextBox control and use the Menu Editor to create an Edit menu (for each of the commands, set the Caption
property = Cut, Copy, Paste, and Delete, respectively; set the Name property = EditCut, EditCopy, EditPaste, and EditDelete,
respectively).

Private Sub EditCut_Click ()


' Clear the contents of the Clipboard.
Clipboard.Clear
' Copy selected text to Clipboard.
ClipBoard.SetText Screen.ActiveControl.SelText
' Delete selected text.
Screen.ActiveControl.SelText = ""
End Sub

Private Sub EditCopy_Click ()


' Clear the contents of the Clipboard.
Clipboard.Clear
' Copy selected text to Clipboard.
ClipBoard.SetText Screen.ActiveControl.SelText
End Sub

Private Sub EditPaste_Click ()


' Place text from Clipboard into active control.
Screen.ActiveControl.SelText = ClipBoard.GetText ()
End Sub

https://msdn.microsoft.com/en-us/library/aa445680(v=vs.60).aspx 1/2
2. 1.2018 SelLength, SelStart, SelText Properties Example

Private Sub EditDelete_Click ()


' Delete selected text.
Screen.ActiveControl.SelText =
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445680(v=vs.60).aspx 2/2
2. 1.2018 SelProtected Property (RichTextBox Control)

This documentation is archived and is not being maintained.

Visual Basic: RichTextBox Control


Visual Studio 6.0

SelProtected Property
See Also Example Applies To

Returns or sets a value which determines if the current selection is protected. Not available at design time.

Syntax

ob/ect.SelProtected [ = value ]

The SelProtected property syntax has the following parts:

Part Description

object An object expression that evaluates to a RichTextBox control.

value A variant value that determines if the current selection is protected, as described in Settings.

Settings

Setting Description

Null The selection contains a mix of protected and non-protected characters.

True All the characters in the selection are protected.

False None of the characters in the selection are protected.

Remarks

Protected text looks the same a regular text, but cannot be modified by the end-user. That is, the text cannot be changed
during run time. This allows you to create forms with the RichTextbox control, and have areas that cannot be modified by
the end user.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa240643(v=vs.60).aspx 1/1
2. 1.2018 SelRTF Property (RichTextBox Control)

This documentation is archived and is not being maintained.

Visual Basic: RichTextBox Control


Visual Studio 6.0

SelRTF Property
See Also Example Applies To

Returns or sets the text (in .rtf format) in the current selection of a RichTextBox control. Not available at design time.

Syntax

ob/ect.SelRTF [= string]

The SelRTF property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

string A string expression in .rtf format.

Remarks

Setting the SelRTF property replaces any selected text in the RichTextBox control with the new string. This property returns
a zero-length string ("") if no text is selected in the control.

You can use the SelRTF property along with the Print function to write .rtf files.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa240644(v=vs.60).aspx 1/1
2. 1.2018 SelRTF Property Example (RichTextBox Control)

Visual Basic: RichTextBox Control


SelRTF Property Example
This example saves the highlighted contents of a RichTextBox control to an .rtf file. To try this example, put a RichTextBox
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 ()


Open "mytext.rtf" For Output As 1
Print #1, RichTextBox1.SelRTF
Close 1

End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa240645(v=vs.60).aspx 1/1
2. 1.2018 SelTabCount, SelTabs Properties (RichTextBox Control)

This documentation is archived and is not being maintained.

Visual Basic: RichTextBox Control


Visual Studio 6.0

SelTabCount, SelTabs Properties


See Also Example Applies To

Returns or sets the number of tabs and the absolute tab positions of text in a RichTextBox control. Not available at design
time.

Syntax

ob/ect.SelTabCount [= count]

object.SelTabs(ndex) [= location]

The SelTabCount and SelTabs properties syntaxes have these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

count An integer that determines the number of tab positions in the selected paragraph(s) or in those paragraph(s)
following the insertion point.

index An integer that identifies a specific tab. The first tab location has an index of zero (0). The last tab location has
an index equal to SelTabCount minus 1.

location An integer that specifies the location of the designated tab. The units used to express tab positions are
determined by the scale mode of the Form object or other object containing the RichTextBox control.

Remarks

By default, pressing TAB when typing in a RichTextBox control causes focus to move to the next control in the tab order, as
specified by the TabIndex property. One way to insert a tab in the text is by pressing CTRL+TAB. However, users who are
accustomed to working with word processors may find the CTRL+TAB key combination contrary to their experience. You can
enable use of the TAB key to insert a tab in a RichTextBox control by temporarily switching the TabStop property of all the
controls on the Form object to False while the RichTextBox control has focus. For example:

Private Sub RichTextBox1_GotFocus()


' Ignore errors for controls without the TabStop property.
On Error Resume Next
' Switch off the change of focus when pressing TAB.
For Each Control In Controls
Control.TabStop = False

https://msdn.microsoft.com/en-us/library/aa240646(v=vs.60).aspx 1/2
2. 1.2018 SelTabCount, SelTabs Properties (RichTextBox Control)

N ext C o n tro l
End Sub

Make sure to reset the TabStop property of the other controls when the RichTextBox control loses focus

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa240646(v=vs.60).aspx 2/2
2. 1.2018 SelTabCount, SelTabs Properties Example (RichTextBox Control)

Visual Basic: RichTextBox Control


SelTabCount, SelTabs Properties Example
This example sets the number of tabs in the selected text to a total of four and then resets the positions of the tabs. To try
this example, put a RichTextBox control on a form and paste this code into the Declarations section of the code window.
Run the example and click the form. After clicking the first time, click in the second line to select it, and click the form again.

Option Explicit

Private Sub Form_Click()


' Reset SelTabs.
With RichTextBox1
.SelTabCount = 4
.SelTabs(0) = 2
.SelTabs(1) = 5
.SelTabs(2) = 10
.SelTabs(3) = 3
End With
End Sub

Private Sub Form_Load()


' Set the ScaleMode to anything but twips, so you can see the
' difference. Resize the width of the form so it's big enough to
' accommodate the textbox.
With Form1
.ScaleMode = vbCentimeters
.ScaleWidth = 20
.ScaleHeight = 10
End With

With RichTextBox1
' Put two identical lines of text into
' the textbox. Tabs separate the characters.
.Text = "0" & vbTab & "1" & vbTab & "2" & vbTab & "3" & vbCrLf &
"0" & vbTab & "1" & vbTab & "2" & vbTab & "3"
' Reposition and resize textbox control.
.Left = 1
.Width = Form1.ScaleWidth - 2
.Height = Form1.ScaleHeight - 2
.Top = 1
' Select the text
.SelLength = 8
End With
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa240647(v=vs.60).aspx 1/1
2. 1.2018 SelText Property (Masked Edit Control)

This documentation is archived and is not being maintained.

Visual Basic: MaskedEdit Control


Visual Studio 6.0

SelText Property (Masked Edit Control)


See Also Example Applies To

Sets or returns the text contained in the control.

Syntax

[/b/m]MaskedEdit.SelText[ = string$]

Remarks

If an input mask is not defined for the Masked Edit control, the SelText property behaves like the standard SelText property
for the Text Box control.

If an input mask is defined and there is selected text in the Masked Edit control, the SelText property returns a text string.
Depending on the value of the ClipMode property, not all the characters in the selected text are returned. If ClipMode is on,
literal characters don't appear in the returned string.

When the SelText property is set, the Masked Edit control behaves as if text was pasted from the Clipboard. This means that
each character in string$ is entered into the control as if the user typed it in.

Data Type

String

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa227876(v=vs.60).aspx 1/1
2. 1.2018 Separators Property

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


Visual Studio 6.0

Separators Property
See Also Example Applies To

Returns or sets a value that determines whether separators are drawn between buttons on a TabStrip control that has the
tabFlatButton style.

Syntax

object.Separators [= boolean]

The Separators property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

boolean A Boolean expression specifying if separators are drawn, as described in Settings.

Settings

The settings for boolean are:

Constant Description

False (Default) Separators aren't drawn.

True Separators are drawn.

Remarks

To see the separators, the TabStrip control's Style property must be set to tabFlatButton.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259692(v=vs.60).aspx 1/1
2. 1.2018 SerialNumber Property

This documentation is archived and is not being maintained.

Visual Basic for Applications Reference


Visual Studio 6.0

SerialNumber Property
See Also Example Applies To Specifics

Description

Returns the decimal serial number used to uniquely identify a disk volume.

Syntax

ob/ect.SerialNumber

The object is always a Drive object.

Remarks

You can use the SerialNumber property to ensure that the correct disk is inserted in a drive with removable media.

The following code illustrates the use of the SerialNumber property:

Sub ShowDriveInfo(drvpath)
Dim fs, d, s, t
Set fs = CreateObject("Scripting.FileSysteiriObject")
Set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(drvpath)))
Select Case d.DriveType
Case 0: t = "Unknown"
Case 1: t = "Removable"
Case 2: t = "Fixed"
Case 3: t = "Network"
Case 4: t = "CD-ROM"
Case 5: t = "RAM Disk"
End Select
s = "Drive " & d.DriveLetter & ": - " & t
s = s & vbCrLf & "SN: " & d.SerialNumber
MsgBox s
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa265837(v=vs.60).aspx 1/1
2. 1.2018 SeriesCoMection Property

This documentation is archived and is not being maintained.

Visual Studio 6.0

Visual Basic: MSChart Control

SeriesCollection Property
See Also Example Applies To

Returns a reference to a SeriesCoMection collection that provides information about the series that make up a chart.

Syntax

object. SeriesCollection

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

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa229061(v=vs.60).aspx 1/1
2. 1.2018 SeriesColumn Property

This documentation is archived and is not being maintained.

Visual Studio 6.0

Visual Basic: MSChart Control

SeriesColumn Property
See Also Example Applies To

Returns or sets the column position for the current series data.

Syntax

ofa/ecf.SeriesColumn [ = pos]

The SeriesColumn property syntax has these parts:

P a rt D e s c r ip tio n

o b ject An o b je c t expression th a t evaluates to an o b je ct in th e Applies To list.

p os In te g e r. The position o f th e colum n containin g th e c u rre n t series data. You can use th is
p ro p e rty to re o rd e r series. I f tw o series are assigned th e sam e position, th e y are stacked.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa229062(v=vs.60).aspx 1/1
2. 1.2018 SeriesMarker Property

This documentation is archived and is not being maintained.

Visual Studio 6.0

Visual Basic: MSChart Control

SeriesMarker Property
See Also Example Applies To

Returns a reference to a SeriesMarker object that describes a marker that identifies all data points within one series on a
chart.

Syntax

ob/ect.SeriesMarker

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

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa229063(v=vs.60).aspx 1/1
2. 1.2018 SeriesType Property

This documentation is archived and is not being maintained.

Visual Studio 6.0

Visual Basic: MSChart Control

SeriesType Property
See Also Example Applies To

Returns or sets the type used to display the current series.

Syntax

ofa/ecf.SeriesType [ = type]

The SeriesType property syntax has these parts:

P a rt D e s c r ip tio n

o b ject An o b je c t expression th a t evaluates to an o b je ct in th e Applies To list.

type In te g e r. A VtC hSeriesType co n sta n t describing th e m ethod used to displa y th e series. You
m u st select th e series to change using th e C o lu m n p ro p e rty before using th e S e rie s T y p e
p ro p e rty.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa229064(v=vs.60).aspx 1/1
2. 1.2018 Server Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

Server Property
See Also Example Applies To

Returns the Active Server Pages Server object.

Syntax

object.Server

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

Remarks

A WebClass uses the Server object to create other objects and determine server-specific properties that might influence its
processing. When creating objects which are to be stored in the Session or Application object, Server.CreateObject must be
used instead of Visual Basics New keyword or CreateObject function.

See the Active Server Pages documentation for details of the properties, methods, and events for the Server object.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445681(v=vs.60).aspx 1/1
2. 1.2018 Session Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

Session Property
See Also Example Applies To

Returns the Active Server Pages Session object.

Syntax

object.Session

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

Remarks

A WebClass uses the Session object to maintain information about the current user session and possibly to store and
retrieve state information. The Session object can be used to maintain state across different WebClasses and between
WebClasses and Active Server Pages.

See the Active Server Pages documentation for details of the properties, methods, and events for the Session object.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445682(v=vs.60).aspx 1/1
2. 1.2018 SessionID Property (MAPIMessages Control) (MAPI)

This documentation is archived and is not being maintained.

Visual Basic: MAPI Controls


Visual Studio 6.0

SessionID Property (MAPIMessages Control)


See Also Example Applies To

Stores the current messaging session handle. This property is not available at design time.

Syntax

o b j e c t .SessionID [ = va lue ]

The SessionID property syntax these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

value A long expression specifying the current session handle.

Remarks

This property contains the messaging session handle returned by the SessionID property of the MAPISession control. To
associate the MAPIMessages control with a valid messaging session, set this property to the SessionID of a MAPISession
control that was successfully signed on.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa228560(v=vs.60).aspx 1/1
2. 1.2018 SessionID Property (MAPISession Control) (MAPI)

This documentation is archived and is not being maintained.

Visual Basic: MAPI Controls


Visual Studio 6.0

SessionID Property (MAPISession Control)


See Also Example Applies To

Returns the current messaging session handle. This property is not available at design time, and is read only at run time.

Syntax

o b j e c t .SessionID

The SessionID property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

Remarks

This property is set when you specify the SignOn method. The SessionID property contains the unique messaging session
handle. The default is 0.

Use this property to set the SessionID property of the MAPIMessages control.

Data Type

Long

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa228562(v=vs.60).aspx 1/1
2. 1.2018 Shadow Property

This documentation is archived and is not being maintained.

Visual Studio 6.0

Visual Basic: MSChart Control

Shadow Property
See Also Example Applies To

Returns a reference to a Shadow object that describes the appearance of a shadow on chart elements.

Syntax

object.Shadow

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

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa229065(v=vs.60).aspx 1/1
2. 1.2018 Shape Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

Shape Property
See Also Example Applies To

Returns or sets a value indicating the appearance of a Shape control.

Syntax

object.Shape [= value]

The Shape property syntax has these parts:

Part Description

Object An object expression that evaluates to an object in the Applies To list.

Value An integer specifying the control's appearance, as described in Settings.

Settings

The settings for value are:

Constant Setting Description

vbShapeRectangle 0 (Default) Rectangle

vbShapeSquare 1 Square

vbShapeOval 2 Oval

vbShapeCircle 3 Circle

vbShapeRoundedRectangle 4 Rounded Rectangle

vbShapeRoundedSquare 5 Rounded Square

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445683(v=vs.60).aspx 1/1
2. 1.2018 Shape Property Example

Visual Basic Reference


Shape Property Example
This example illustrates the six possible shapes of the Shape control. To try this example, paste the code into the
Declarations section of a form that contains an OptionButton control and a Shape control. For the OptionButton, set the
Index property to 0 to create a control array of one element, and then press F5. Click each OptionButton to see each
different shape.

Private Sub Form_Load ()


Dim I ' Declare variable.
Option1(0).Caption = "Shape #0"
For I = 1 To 5 ' Create five instances of Option1.
Load Option1(I)
' Set the location of the new option button.
Option1(I).Top = Option1(I - 1).Top + Option1(0).Height + 40
' Set the option button caption.
Option1(I).Caption = "Shape #" & I
' Display the new option button.
Option1(I).Visible = True
Next I
End Sub

Private Sub Option1_Click (Index As Integer)


Shape1.Shape = Index
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa445685(v=vs.60).aspx 1/1
2. 1.2018 ShapeText Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

ShapeText Property
See Also Example Applies To

Specifies the SHAPE string generated by the DataEnvironment object for a Command hierarchy.

Syntax

object.ShapeText [=stnng]

The ShapeText property syntax has these parts:

Part Description

object An object expression that evaluates to an item in the Applies To list.

string A string expression that generates when you create a Command hierarchy either by relating two DECommand
objects or by grouping a DECommand object.

Remarks

This property is only applicable to the top-most DECommand object that is either grouped or in a relation hierarchy.
Alternatively, this property is null and cannot be set.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa445684(v=vs.60).aspx 1/1
2. 1.2018 Shareable Property (Multimedia MCI Control) (Multimedia MCI Control)

This documentation is archived and is not being maintained.

Visual Basic: Multimedia MCI Control


Visual Studio 6.0

Shareable Property (Multimedia MCI Control)


See Also Example Applies To

Determines if more than one program can share the same MCI device.

Syntax

[form.]MMControl.Shareable[ = {True | False}]

Remarks

The following table lists the Shareable property settings for the Multimedia MCI control.

Setting Description

False No other controls or applications can access this device.

True More than one control or application can open this device.

Data Type

Integer (Boolean)

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa228370(v=vs.60).aspx 1/1
2. 1.2018 Examples (Multimedia MCI Control) (Multimedia MCI Control)

Visual Basic: Multimedia MCI Control


Examples (Multimedia MCI Control)
Visual Basic Example

The following example illustrates the procedure used to open an MCI device with a compatible data file. By placing this code
in the Form_Load procedure, your application can use the Multimedia MCI control "as is" to play, record, and rewind the file
Gong.wav. To try this example, first create a form with a Multimedia MCI control.

Private Sub Form_Load ()


' Set properties needed by MCI to open.
MMControl1.Notify = FALSE
MMControl1.Wait = TRUE
MMControl1.Shareable = FALSE
MMControl1.DeviceType = "WaveAudio"
MMContron.FileName = "C:\WINDOWS\MMDATA\GONG.WAV"

' Open the MCI WaveAudio device.


MMControl1.Command = "Open"
End Sub

To properly manage multimedia resources, you should close those MCI devices that are open before exiting your application.
You can place the following statement in the Form_Unload procedure to close an open MCI device before exiting from the
form containing the Multimedia MCI control.

Private Sub FormJJnload (Cancel As Integer)


MMControl1.Command = "Close"
End Sub

© 2018 Microsoft

https://msdn.microsoftcom/en-us/library/aa228242(v=vs.60).aspx 1/1
2. 1.2018 ShareName Property

This documentation is archived and is not being maintained.

Visual Basic for Applications Reference


Visual Studio 6.0

ShareName Property
See Also Example Applies To Specifics

Description

Returns the network share name for a specified drive.

Syntax

ob/ect.ShareName

The object is always a Drive object.

Remarks

If object is not a network drive, the ShareName property returns a zero-length string ("").

The following code illustrates the use of the ShareName property:

Sub ShowDrivelnfo(drvpath)
Dim fs, d, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(drvpath)))
s = "Drive " & d.DriveLetter & ": - " & d.ShareName
MsgBox s
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa265845(v=vs.60).aspx 1/1
2. 1.2018 Shortcut Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

Shortcut Property
See Also Example Applies To

Sets a value that specifies a shortcut key for a Menu object. Not available at run time.

Remarks

Use this property to provide keyboard shortcuts for menu commands. You can set this property using the Menu Editor. For a
list of shortcut keys you can use, see the Shortcut list in the Menu Editor.

Note In addition to shortcut keys, you can also assign access keys to commands, menus, and controls by using an
ampersand (&) in the Caption property setting.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445686(v=vs.60).aspx 1/1
2. 1.2018 ShortName Property

This documentation is archived and is not being maintained.

Visual Basic for Applications Reference


Visual Studio 6.0

ShortName Property
See Also Example Applies To Specifics

Description

Returns the short name used by programs that require the earlier 8.3 naming convention.

Syntax

objectShortName

The object is always a File or Folder object.

Remarks

The following code illustrates the use of the ShortName property with a File object:

Sub ShowShortName(filespec)
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(filespec)
s = "The short name for " & "" & UCase(f.Name)
s = s & "" & vbCrLf
s = s & "is: " & "" & f.ShortName & ""
MsgBox s, 0, "Short Name Info"
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa265859(v=vs.60).aspx 1/1
2. 1.2018 ShortPath Property

This documentation is archived and is not being maintained.

Visual Basic for Applications Reference


Visual Studio 6.0

ShortPath Property
See Also Example Applies To Specifics

Description

Returns the short path used by programs that require the earlier 8.3 file naming convention.

Syntax

objectShortPath

The object is always a File or Folder object.

Remarks

The following code illustrates the use of the ShortName property with a File object:

Sub ShowShortPath(filespec)
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(filespec)
s = "The short path for " & "" & UCase(f.Name)
s = s & "" & vbCrLf
s = s & "is: " & "" & f.ShortPath & ""
MsgBox s, 0, "Short Path Info"
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa265866(v=vs.60).aspx 1/1
2. 1.2018 Show Property

This documentation is archived and is not being maintained.

Visual Studio 6.0

Visual Basic: MSChart Control

Show Property
See Also Example Applies To

Returns or sets a value that determines whether series markers are displayed on a chart.

Syntax

object.Show [ = boolean]

The Show property syntax has these parts:

P a rt D e s c rip tio n

o b ject An o b je ct expression th a t evaluates to an o b je ct in th e Applies To list.

boolean A Boolean expression th a t controls w h e th e r series m arkers are displayed, as described in


S ettings.

Settings

The settings for boolean are:

S e ttin g D e s c rip tio n

T ru e Series m arkers are displayed

F a ls e (D e fa u lt) Series m arke rs are no t displayed.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa229069(v=vs.60).aspx 1/1
2. 1.2018 ShowFocusRect Property (MSTab Control) (SSTab Control)

This documentation is archived and is not being maintained.

Visual Basic: MSTab Control


Visual Studio 6.0

ShowFocusRect Property
See Also Example Applies To

Returns or sets a value that determines if the focus rectangle is visible on a tab on an SSTab control when the tab gets the
focus.

Syntax

ob/ect.ShowFocusRect [ = boolean ]

The ShowFocusRect property syntax has these parts:

Part Description

object An object expressionthat evaluates to an SSTab control.

boolean A Boolean expression that specifies how the focus rectangle behaves, as described in Settings.

Settings

The settings for boolean are:

Setting Description

True (Default) The control shows the focus rectangle on the tab that has the focus.

False The control does not show the focus rectangle on the tab that has the focus.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa228557(v=vs.60).aspx 1/1
2. 1.2018 ShowGrabHandles Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

ShowGrabHandles Property
See Also Example Applies To

Returns a boolean value stating whether the control should show grab handles.

Syntax

ob/ecf.ShowGrabHandles

The ShowGrabHandles property syntax has this part:

Part Description

object An object expression that evaluates to an object in the Applies To list.

Settings

The possible boolean return values from the ShowGrabHandles property are:

Setting Description

True The control should show grab handles, if needed. If the container does not implement this ambient property,
this will be the default value.

False The control should not show grab handles.

Remarks

The default behavior for a control is to automatically show grab handles when the control is in a container that is in design
mode (the controls run mode.) However, many containers do not want the control to show grab handles, preferring to
handle the indication of control sizing in another way. The ShowGrabHandles property is how the container notifies the
control of who is to display the sizing indications.

Note All known containers prefer to handle the indication of control sizing themselves, and therefore set the
ShowGrabHandles property to False. It is probably not necessary to actually handle the case when ShowGrabHandles is
True.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445687(v=vs.60).aspx 1/1
2. 1.2018 ShowGuideLine Property

This documentation is archived and is not being maintained.

Visual Studio 6.0

Visual Basic: MSChart Control

ShowGuideLine Property
See Also Example Applies To

Returns or sets a value that determines whether or not the connecting data point lines on a chart are displayed for a series.

Syntax

ob/ect.ShowGuideLmes (axisId, index) [ = boolean ]

The ShowGuideLine property syntax has these parts:

P a rt D e s c rip tio n

o b ject An o b je ct expression th a t evaluates to an o b je ct in th e Applies To list.

a xisId In te g e r. A V tC hA xisId co n sta n t describing th e series axis you w a n t to set th is p ro p e rty for.

in d ex In te g e r. An in te g e r reserved fo r fu tu re use. For th is version o f M SChart co n tro l, 1 is th e only


valid value fo r th is arg u m e n t.

boolean A Boolean expression th a t controls w h e th e r th e series is charted on th e secondary axis, as


described in S ettings.

Settings

The settings for boolean are:

S e ttin g D e s c rip tio n

T ru e The series guidelines are displayed.

F a ls e (D e fa u lt) The series guidelines are no t displayed.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa229066(v=vs.60).aspx 1/1
2. 1.2018 ShowHatching Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

ShowHatching Property
See Also Example Applies To

Returns a boolean value stating whether the control should show hatching around the control.

Syntax

ob/ecf.ShowHatching

The ShowHatching property syntax has this part:

Part Description

object An object expression that evaluates to an object in the Applies To list.

Settings

The possible boolean return values from the ShowHatching property are:

Setting Description

True The control should show hatch marks, if needed. If the container does not implement this ambient property,
this will be the default value.

False The control should not show hatch marks.

Remarks

The default behavior for a control is to automatically show hatching when the control is in a container that is in design mode
(the controls run mode) and the control is the one that has focus. However, many containers do not want the control to show
hatching, preferring to handle the indication of control focus in another way. The ShowHatching property is how the
container notifies the control of who is to display the control focus indications.

Note Visual Basic forms do not implement this ambient property, and therefore the ShowHatching property is set to the
default value of True when the control is placed in a Visual Basic form. However, Visual Basic does not expect the control to
actually do anything in response to a ShowHatching value of True, therefore it is probably not necessary to actually handle
the case when ShowHatching is True.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445688(v=vs.60).aspx 1/1
2. 1.2018 ShowInTaskbar Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

ShowInTaskbar Property
See Also Example Applies To

Returns or sets a value that determines whether a Form object appears in the Windows taskbar. Read-only at run time.

Syntax

ob/ect.ShowInTaskbar

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

Settings

The settings for the ShowInTaskbar property are:

Setting Description

True (Default) The Form object appears in the taskbar.

False The Form object does not appear in the taskbar.

Remarks

Use the ShowInTaskbar property to keep dialog boxes in your application from appearing in the taskbar.

The default value for the ShowInTaskbar property assumes the default setting for the BorderStyle property of the Form
object (Sizable). Changing the BorderStyle property may change the setting of the ShowInTaskbar property.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445689(v=vs.60).aspx 1/1
2. 1.2018 ShowLegend Property

This documentation is archived and is not being maintained.

Visual Studio 6.0

Visual Basic: MSChart Control

ShowLegend Property
See Also Example Applies To

Returns or sets a value that indicates whether a legend is visible for a chart.

Syntax

ob/ecf.ShowLegend [ = boolean]

The ShowLegend property syntax has these parts:

P a rt D e s c rip tio n

o b ject An o b je ct expression th a t evaluates to an o b je ct in th e Applies To list.

boolean A Boolean expression th a t controls w h e th e r a legend is displayed on th e ch a rt, as described


in S ettings.

Settings

The settings for boolean are:

S e ttin g D e s c rip tio n

T ru e The legend appears on th e ch a rt in th e position indicated by th e L o c a tio n object.

F a ls e (D e fa u lt) The legend is not displayed on th e chart. The d e fa u lt legend location is to th e rig h t
side o f th e chart.

Remarks

The default legend location is to the right side of the chart.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa229067(v=vs.60).aspx 1/1
2. 1.2018 ShowLine Property

This documentation is archived and is not being maintained.

Visual Studio 6.0

Visual Basic: MSChart Control

ShowLine Property
See Also Example Applies To

Returns or sets a value that determines whether the lines connecting data points on a chart are visible.

Syntax

object.ShowLine [ = boolean]

The ShowLine property syntax has these parts:

P a rt D e s c rip tio n

o b ject An o b je ct expression th a t evaluates to an o b je ct in th e Applies To list.

boolean A Boolean expression th a t controls w h e th e r lines are displayed, as described in S ettings.

Settings

The settings for boolean are:

S e ttin g D e s c rip tio n

T ru e (D e fa u lt) The lines connecting data points appear on th e chart.

F a ls e The data p o in t lines do no t appear.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa229068(v=vs.60).aspx 1/1
2. 1.2018 ShowPropertiesAfterCreate Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

ShowPropertiesAfterCreate Property
See Also Example Applies To

Specifies whether the Properties dialog box displays immediately after a DECommand or DEConnection object is created.

Syntax

ob/ecf.ShowProperties [=Soo/eon]

The ShowProperties property syntax has these parts:

Part Description

object An object expression that evaluates to an item in the Applies To list.

Boolean A Boolean expression that specifies whether the Command or Connection Properties dialog box displays
after a DECommand or DEConnection object is created.

Remarks

This property corresponds to the Show Properties A fter Create check box in the Options dialog box and is specific to your
system. Therefore, changing it for one DataEnvironment object automatically changes it for all DataEnvironment objects on
your system.

When adding an object using the Data Environment Extensibility Object Model, first set the ShowPropertiesAfterCreate
property to False to prevent the Properties dialog box from appearing.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa445690(v=vs.60).aspx 1/1
2. 1.2018 ShowStatusBar Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

ShowStatusBar Property
See Also Example Applies To

Specifies whether the status bar displays in the Data Environment designer window.

Syntax

ob/ecf.ShowStatusBar [=Soo/eon]

The ShowStatusBar property syntax has these parts:

Part Description

object An object expression that evaluates to an item in the Applies To list.

Boolean A Boolean expression that specifies whether the status bar displays in the Data Environment designer window.

Remarks

This property corresponds to the Show Status Bar check box in the Options dialog box and is specific to your system.
Therefore, changing it for one DataEnvironment object automatically changes it for all DataEnvironment objects on your
system.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445691(v=vs.60).aspx 1/1
2. 1.2018 ShowSystemObjects Property

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

ShowSystemObjects Property
See Also Example Applies To

Specifies whether system database objects display in the Database Object drop-down list on the General tab of the
Command Properties dialog box.

Syntax

ob/ect.ShowSystemObjects [=Soo/eon]

The ShowSystemObjects property syntax has these parts:

Part Description

object An object expression that evaluates to an item in the Applies To list.

Boolean A Boolean expression that specifies whether the system database objects display in the Command Properties
dialog box.

Remarks

This property corresponds to the Show System Objects check box in the Options dialog box and is specific to your system.
Therefore, changing it for one DataEnvironment object automatically changes it for all DataEnvironment objects on your
system.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445692(v=vs.60).aspx 1/1
2. 1.2018 ShowTips Property (ActiveX Controls) (Appearance Property (ActiveX Controls))

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

ShowTips Property (ActiveX Controls)


See Also Example Applies To

Returns a value that determines whether ToolTips are displayed for an object.

Syntax

ob/ect.ShowTips

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

Return Values

A Boolean expression specifying whether ToolTips are displayed, as described in Settings

Settings

The settings for value are:

Setting Description

True (Default) Each object in the control can display an associated string, which is the setting of the ToolTipText
property, in a small rectangle below the object. This ToolTip appears when the user's cursor hovers over the
object at run time for about one second.

False An object will not display a ToolTip at run time.

Remarks

At design time you can set the ShowTips property on the General tab in the control's Property Pages dialog box. It is read­
only at run time.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa443255(v=vs.60).aspx 1/1
2. 1.2018 ShowToday Property (Windows Controls)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


Visual Studio 6.0

ShowToday Property
See Also Example Applies To

Returns or sets a value that determines if the current date is displayed at the bottom of the control.

Syntax

object.ShowToday [= boolean]

The ShowToday property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

boolean A Boolean expression specifying the status of the current date indicators.

Settings

The settings for boolean are:

Setting Description

True (Default) The current date is displayed.

False The current date is not displayed.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa276676(v=vs.60).aspx 1/1
2. 1.2018 ShowWeekNumbers Property (Windows Controls)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


Visual Studio 6.0

ShowWeekNumbers Property
See Also Example Applies To

Returns or sets a value that determines if the week numbers are displayed next to each week.

Syntax

ob/ect.ShowWeekNumbers [= boolean]

The ShowWeekNumbers property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

boolean A Boolean expression specifying the status of the current date indicators.

Settings

The settings for boolean are:

Setting Description

True Week numbers are displayed.

False (Default) Week numbers are not displayed.

Remarks

Week numbers are displayed to the left of the week, and start from the first week of the calendar year.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa276789(v=vs.60).aspx 1/1
2. 1.2018 Silent Property (Multimedia MCI Control) (Multimedia MCI Control)

This documentation is archived and is not being maintained.

Visual Basic: Multimedia MCI Control


Visual Studio 6.0

Silent Property (Multimedia MCI Control)


See Also Example Applies To

Determines if sound plays.

Syntax

[form.]MMControl.Silent[ = {True | False}]

Remarks

The following table lists the Silent property settings for the Multimedia MCI control.

Setting Description

False Any sound present is played.

True Sound is turned off.

Data Type

Integer (Boolean)

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa228375(v=vs.60).aspx 1/1
2. 1.2018 SimpleText Property

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


Visual Studio 6.0

SimpleText Property
See Also Example Applies To

Returns or sets the text displayed when a StatusBar control's Style property is set to Simple.

Syntax

object.SimpleText [= string]

The Sim pleText property syntax has these parts:

Part Description

object An object expression that evaluates to a StatusBar control.

string A string that is displayed when the Style property is set to Simple.

Remarks

The StatusBar control has a Style property which can be toggled between Simple and Normal styles. When in Simple style,
the status bar displays only one panel. The text displayed in Simple style is also different from that displayed in Normal style.
This text is set with the SimpleText property.

The Sim pleText property can be used in situations where an application's mode of operation temporarily switches. For
example, when a menu is pulled down, the SimpleText could describe the menu's purpose.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa259693(v=vs.60).aspx 1/1
2. 1.2018 SimpleText Property Example

Visual Basic: Windows Controls


SimpleText Property Example
This example adds two Panel objects to a StatusBar control that appear in Normal style, and then adds a string (using the
SimpleText property) that appears when the Style property is set to Simple. The control toggles between the Simple style
and the Normal style. To try the example, place a StatusBar control on a form and paste the code into the Declarations
section of the form. Run the example and click on the StatusBar control.

Private Sub Form_Load()


Dim I As Integer
For I = 1 to 2
StatusBar1.Panels.Add ' Add 2 Panel objects.
Next I

With StatusBar1.Panels
.Item(1).Style = sbrNum ' Number lock
.Item(2).Style = sbrCaps ' Caps lock
.Item(3).Style = sbrScrl ' Scroll lock
End With
End Sub

Private Sub StatusBar1_Click()


' Toggle between simple and normal style.
With StatusBar1
If .Style = 0 Then
' This text will be displayed when the StatusBar is in Simple style.
.SimpleText = "Date and Time: " & Now
.Style = sbrSimple ' Simple style.
Else
.Style = sbrNormal ' Normal style.
End If
End With
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259694(v=vs.60).aspx 1/1
2. 1.2018 SingleSel Property

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


Visual Studio 6.0

SingleSel Property
See Also Example Applies To

Returns or sets a value that specifies if an item is expanded when selected.

Syntax

ob/ect.SingleSel [= boolean]

The SingleSel property syntax has these parts:

Part Description

object An object expression that evaluates to an object in the Applies To list.

boolean A Boolean expression specifying if an item is expanded upon selection, as described in Settings.

Settings

The settings for boolean are:

Constant Description

False (Default) The item doesn't expand when selected.

True The item expands when selected.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259695(v=vs.60).aspx 1/1
2. 1.2018 Size Property (DEDesigner Extensibility)

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

Size Property (DEDesigner Extensibility)


See Also Example Applies To

Specifies the maxim um size, in bytes, of a D E P a ra m e te r object.

S y n ta x

o b je c t.S iz e [= value]

The S ize property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an item in the Applies To list.

value A Long expression that specifies the size of the D E P a ra m e te r object.

R e m a rks

This property corresponds to the ADO Param eter Size property.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445694(v=vs.60).aspx 1/1
2. 1.2018 Size Property (FileSystemObject object)

This documentation is archived and is not being maintained.

Visual Basic for Applications Reference


Visual Studio 6.0

Size Property
See Also Example Applies To Specifics

Description

For files, returns the size, in bytes, of the specified file. For folders, returns the size, in bytes, of all files and subfolders
contained in the folder.

Syntax

object. Size

The object is always a File or Folder object.

Remarks

The following code illustrates the use of the Size property with a Folder object:

Sub ShowFolderSize(filespec)
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(filespec)
s = UCase(f.Name) & " uses " & f.size & " bytes."
MsgBox s, 0, "Folder Size Info"
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa243182(v=vs.60).aspx 1/1
2. 1.2018 Size Property (Font)

This documentation is archived and is not being maintained.

Visual Basic Reference


Visual Studio 6.0

Size Property (Font)


See Also Example Applies To

Returns or sets the font size used in the Font object.

Syntax

object.Size [= number]

The Size 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 specifying the size of the font in points.

Remarks

Use this property to format text in the font size you want. The default font size is determined by the operating system. To
change the default, specify the size of the font in points. The maximum value for the Size property is 2048 points.

The Font object isn't directly available at design time. Instead you set the Size property by selecting a control's Font
property in the Properties window and clicking the Properties button. In the Size box of the Font dialog box, select the size
you want. At run time, however, set Size directly by specifying its setting for the Font object.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445693(v=vs.60).aspx 1/1
2. 1.2018 Bold, Italic, Size, StrikeThrough, Underline, Weight Properties Example

Visual Basic Reference


Bold, Italic, Size, StrikeThrough, Underline,
Weight Properties Example
This exam ple prints text on a form with each mouse click. To try this exam ple, paste the code into the Declarations section of
a form, and then press F5 and click the form twice.

Private Sub Form_Click ()


Font.Bold = Not Font.Bold ' Toggle bold.
Font.StrikeThrough = Not Font.StrikeThrough ' Toggle strikethrough.
Font.Italic = Not Font.Italic ' Toggle italic.
Font.Underline = Not Font.Underline ' Toggle underline.
Font.Size = 16 ' Set Size property.
If Font.Bold Then
Print "Font weight is " & Font.Weight & " (bold)."
Else
Print "Font weight is " & Font.Weight & " (not bold)."
End If
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa245044(v=vs.60).aspx 1/1
2. 1.2018 Size Property (MSChart)

This documentation is archived and is not being maintained.

V isu a l S tu d io 6 .0

Visual Basic: MSChart Control

Size Property (MSChart)


See Also Example Applies To

Returns or sets the size of a chart elem ent in points.

S y n ta x

o b je ct .S ize [ = size]

The S ize property syntax has these parts:

P a rt D e s c r ip tio n

o b ject An o b je c t expression th a t evaluates to an o b je ct in th e Applies To list.

size Single. Size o f th e ch a rt e le m e n t in points.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa229070(v=vs.60).aspx 1/1
2. 1.2018 Size Property (Remote Data) (RemoteData Control)

This documentation is archived and is not being maintained.

Visual Basic: RDO Data Control


V isu a l S tu d io 6 .0

Size Property (Remote Data)


See Also Example Applies To

Returns a value that indicates the maxim um size, in bytes, of the underlying data of an rd o C o lu m n object that contains text
or the fixed size of an rd o C o lu m n object that contains text or num eric values.

S y n ta x

o b je c t.S iz e

The o b je c t placeholder is an object expression that evaluates to an object in the Applies To list.

R e tu rn V a lu e s

The S ize property return value is a Long value. The value depends on the T y p e property setting of the rd o C o lu m n object, as
discussed in Remarks.

R e m a rks

For columns that return character values, the S ize property indicates the maxim um num ber of characters that the data
source column can hold. For num eric colum ns, the S ize property indicates how m any bytes of data source storage are
required for the column data. This value depends on the data source im plem entation.

For data source colum ns that require the use of G e tC h u n k and A p p e n d C h u n k methods, the Size property is always 0 you
can use the C o lu m n S ize method to return correct size inform ation. The maxim um size of a c h u n k -ty p e column is limited
only by your system resources or the maxim um size of the database.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263034(v=vs.60).aspx 1/1
2. 1.2018 Size Property (Split Object) (DataGrid Control)

This documentation is archived and is not being maintained.

Visual Basic: DataGrid Control


V isu a l S tu d io 6 .0

Size Property (Split Object)


See Also Example Applies To

Sets or returns the size of a split.

S y n ta x

o b je c t.S iz e [= value]

The S ize property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

value An integer expression that specifies the size of the split.

R e m a rks

The meaning of the value returned by this property is determined by the split's S ize M o d e property setting.

If S ize M o d e is set to the default value of 0 - Scalable, the value returned by the S ize property is an integer indicating the
relative size of the split with respect to other scalable splits.

If S ize M o d e is set to 1 - Exact, the value returned by the S ize property is a floating point num ber indicating the exact size of
the split in term s of the coordinate system of the grid's container.

N o te W hen there is only one split (the grid's default behavior), the split spans the entire width of the grid, the Size M o d e
property is always 0 - d b g S calab le , and the S ize property is always 1. Setting either of these properties has no effect when
there is only one split. If there are multiple splits, and you then remove all but one, the S ize M o d e and S ize properties of the
remaining split autom atically revert to 0 and 1, respectively.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa227385(v=vs.60).aspx 1/1
2. 1.2018 SizeMode Property (RptImage Control)

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

SizeMode Property (RptImage Control)


See Also Example Applies To

Returns or sets a value that specifies how to size a picture in the Data Report designer's Im age control.

S y n ta x

ofa/ecf.SizeMode [= integer]

The S ize M o d e property syntax has these parts:

P a rt D e scrip tio n

o b je ct Required. An object expression that evaluates to an object in the Applies To list.

in te g e r Optional. A num eric expression that specifies how a picture will be sized, as shown in Settings.

S e ttin g s

The settings for in te g e r are:

C o n sta n t V a lu e D e scrip tio n

rp tS ize C lip 0 The picture will be clipped.

rp tS iz e S tre tc h 1 The picture will be stretched to fit the control.

rp tS ize Z o o m 2 Same as stretched, except the X:Y proportion of the image remains constant.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445696(v=vs.60).aspx 1/1
2. 1.2018 SizeMode Property (Split Object) (DataGrid Control)

This documentation is archived and is not being maintained.

Visual Basic: DataGrid Control


V isu a l S tu d io 6 .0

SizeMode Property (Split Object)


See Also Example Applies To

Sets or returns a value that determ ines how the S ize property is used to determ ine the actual size of a split.

S y n ta x

ob/ect.SizeM ode [= value]

The S ize M o d e property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

value A num ber or constant that determ ines how the S ize property is used, as described in Settings.

S e ttin g s

The settings for va lue are:

C o n sta n t V a lu e D e scrip tio n

d b g S c a la b le 0 (default) The value returned by the Size property is an integer indicating the relative size of the
split with respect to other scalable splits. For exam ple, if a grid contains 3 scalable splits with
S ize properties equal to 1, 2, and 3, the size of each split would be 1/6, 1/3, and 1/2 of the total
grid w idth, respectively.

d b g E xa ct 1 The value returned by the Size property is a floating point num ber indicating the exact size of
the split in term s of the coordinate system of the grid's container. This setting allows you to fix
the size of the split so that it always has the same w idth, even if new splits are added or existing
splits are removed.

R e m a rks

W hen there is only one split (the grid's default behavior), the split spans the entire width of the grid, the S ize M o d e property
is always 0 - d b g S ca la b le , and the S ize property is always 1. Setting either of these properties has no effect w hen there is
only one split. If there are multiple splits, and you then remove all but one, the S ize M o d e and S ize properties of the
remaining split autom atically revert to 0 and 1, respectively.

https://msdn.microsoft.com/en-us/library/aa227384(v=vs.60).aspx 1/2
2. 1.2018 SizeMode Property (Split Object) (DataGrid Control)

Consider a grid containing both scalable splits and splits with a fixed num ber of colum ns. If a split with a fixed num ber of
colum ns is scrolled horizontally, the total width remaining for the scalable splits m ay change because grid colum ns are
generally of different w idths. However, the ratios of the sizes of the scalable splits remain the same as specified by their Size
properties.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa227384(v=vs.60).aspx 2/2
2. 1.2018 SizeMode Property

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

SizeMode Property
See Also Example Applies To

Returns or sets a value specifying how the O LE container control is sized or how its image is displayed w hen it contains an
object.

S y n ta x

ob/ect.SizeM ode [ = value]

The S ize M o d e property syntax has these parts:

P a rt D e scrip tio n

O b ject An object expression that evaluates to an object in the Applies To list.

V alue An integer or constant specifying how the control is sized or how its im age is displayed, as described in Settings.

S e ttin g s

The settings for va lue are:

C o n sta n t V a lu e D e scrip tio n

V b O L E S ize C lip 0 (Default) Clip. The object is displayed in actual size. If the object is larger than the O LE
container control, its im age is clipped by the control's borders.

V b O L E S ize S tre tc h 1 Stretch. The object's image is sized to fill the O LE container control. The im age m ay not
maintain the original proportions of the object.

V b O L E S iz e A u to S ize 2 Autosize. The O LE container control is resized to display the entire object.

V b O LES ize Z o o m 3 Zoom . The object is resized to fill the O LE container control as much as possible while
still maintaining the original proportions of the object.

R e m a rks

W hen S ize M o d e is set to 2 (Autosize), the O LE container control is autom atically resized when the display size of an object
changes. W hen this occurs, the Resize event is invoked before the O LE container control is autom atically resized. The

https://msdn.microsoft.com/en-us/library/aa445695(v=vs.60).aspx 1/2
2. 1.2018 SizeMode Property

h e ig h tn e w and w id th n e w argum ents in the Resize event procedure indicate the optimal size for displaying the object (this
size is determined by the application that created the object). You can size the control by changing the values of the
h e ig h tn e w and w id th n e w argum ents in the Resize event procedure.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445695(v=vs.60).aspx 2/2
2. 1.2018 SocketHandle Property (Winsock Control)

This documentation is archived and is not being maintained.

Visual Basic: Winsock Control


V isu a l S tu d io 6 .0

SocketHandle Property
See Also Example Applies To

Returns a value that corresponds to the socket handle the control uses to com m unicate with the W insock layer. Read-only
and unavailable at design time.

S y n ta x

object. S o ck e tH a n d le

The o b je c t placeholder represents an object expression that evaluates to an object in the Applies To list.

D ata T yp e

Long

R e m a rks

This property w as designed to be passed to W insock APIs.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa228155(v=vs.60).aspx 1/1
2. 1.2018 Sort Property (MSHFlexGrid) (MSFlexGrid/MSHFlexGrid Controls)

This documentation is archived and is not being maintained.

Visual Basic: MSFlexGrid/MSHFlexGrid


Controls
V isu a l S tu d io 6 .0

Sort Property (MSHFlexGrid)


See Also Example Applies To

Sets a value that sorts selected rows according to selected criteria. This property is not available at design time.

S y n ta x

o b je c t.S o r t [= value]

The S o rt property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

value An integer or constant that specifies the type of sorting, as described in Settings.

S e ttin g s

The settings for va lue are:

C o n sta n t V a lu e D e scrip tio n

fle x S o rtN o n e 0 None. No sorting is performed.

fle x S o rtG e n e ric A sc e n d in g 1 Generic Ascending. An ascending sort, which estim ates w hether text is string
or num ber, is performed.

fle x S o rtG e n e ricD e sce n d in g 2 Generic Descending. A descending sort, which estim ates w hether text is
string or num ber, is performed.

fle x S o rtN u m e ric A sc e n d in g 3 Numeric Ascending. An ascending sort, which converts strings to num bers, is
performed.

fle x S o rtN u m e ric D e sc e n d in g 4 Numeric Descending. A descending sort, which converts strings to num bers,
is performed.

fle x S o rtS trin g N o C a se A se n d in g 5 String Ascending. An ascending sort using case-insensitive string

https://msdn.microsoft.com/en-us/library/aa261266(v=vs.60).aspx 1/2
2. 1.2018 Sort Property (MSHFlexGrid) (MSFlexGrid/MSHFlexGrid Controls)

com parison is performed.

fle x S o rtN o C a se D e sce n d in g 6 String Descending. A descending sort using case-insensitive string
com parison is performed.

fle x S o rtS trin g A sc e n d in g 7 String Ascending. An ascending sort using case-sensitive string com parison
is performed.

fle x S o rtS trin g D e sc e n d in g 8 String Descending. A descending sort using case-sensitive string com parison
is performed.

fle x S o rtC u s to m 9 Custom. This uses the C o m p a re event to com pare rows.

R e m a rks

The S o rt property always sorts entire rows. To specify the range to be sorted, set the R o w and R o w S e l properties. If R o w
and R o w Se l are the same, the M S H F le xG rid will sort all non-fixed rows.

The keys used for sorting are determ ined by the Col and C o lS e l properties. Sorting is always done in a left-to-right direction.
For exam ple, if C ol =3 and C o lSe l =1, the sort is done according to the contents of colum ns 1, then 2, then 3.

The method used to com pare the rows is determ ined by the value, as explained in Settings. The 9 (Custom) setting is the
most flexible, but is slow er than the other settings, typically by a factor of ten. An alternative to using this setting is to create
an invisible colum n, fill it with the keys, and then perform a sort based on Custom using another setting. This is a good
approach for sorts that are based on dates.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa261266(v=vs.60).aspx 2/2
2. 1.2018 Sort, TextMatrix Properties (MSHFlexGrid) Example (MSFlexGrid/MSHFlexGrid Controls)

Visual Basic: MSFlexGrid/MSHFlexGrid


Controls
Sort, TextMatrix Properties (MSHFlexGrid)
Example
The following exam ple uses the S o rt and T e x tM a trix properties. It performs an M S H F le x G rid sort according to the value of
a C o m b o B o x control. To use the exam ple, place an M S H F le x G rid control and a C o m b o B o x control on a form. Paste the
following code into the Declarations section, and then press F5.

N o te If you are using the M S F le xG rid , substitute "M SHFlexGrid1" with "M SFlexGrid1."

Private Sub Combo1_Click()


' Select Column according to Sort method.
Select Case Combo1.ListIndex
Case 0 To 2
MSHFlexGrid1.Col =1
Case 3 To 4
MSHFlexGrid1.Col =2
Case 4 To 8
MSHFlexGrid1.Col =1
End Select
' Sort according to Combo1.ListIndex.
MSHFlexGrid1.Sort =Combo1.ListIndex
End Sub
Private Sub Form_Load()
Dim i As Integer
' Fill MSHFlexGrid with random data.
MSHFlexGrid1.Cols =3 ' Create three columns.

For i =1 To 11 ' Add ten items.


MSHFlexGrid1.AddItem
MSHFlexGrid1.Col =2
MSHFlexGrid1.TextMatrix(i, 1) =SomeName(i)
MSHFlexGrid1.TextMatrix(i, 2) =Rnd()
Next i
' Fill combo box with Sort choices
With Combo1
.AddItem "flexSortNone" ' 0
.AddItem "flexSortGenericAscending" '1
.AddItem "flexSortGenericDescending" '2
.AddItem "flexSortNumericAscending" '3
.AddItem "flexSortNumericDescending" '4
.AddItem "flexSortStringNoCaseAsending" '5
.AddItem "flexSortNoCaseDescending" '6
.AddItem "flexSortStringAscending" '7
.AddItem "flexSortStringDescending" '8
.ListIndex =0
End With
End Sub
Private Function SomeName(i As Integer) As String
Select Case i

https://msdn.microsoft.com/en-us/library/aa261267(v=vs.60).aspx 1/2
2. 1.2018 Sort, TextMatrix Properties (MSHFlexGrid) Example (MSFlexGrid/MSHFlexGrid Controls)

Case 1
SomeName ="Ann"
Case 2
SomeName ="Glenn"
Case 3
SomeName ="Sid"
Case 4
SomeName ="Anton"
Case 5
SomeName ="Hoagie"
Case 6
SomeName ="Traut 'Trane"
Case 7
SomeName ="MereD Wah"
Case 8
SomeName ="Kemp"
Case 9
SomeName ="Sandy"
Case 10
SomeName ="Lien"
Case 11
SomeName ="Randy"
End Select
End Function

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa261267(v=vs.60).aspx 2/2
2. 1.2018 Sort Property (MSChart)

This documentation is archived and is not being maintained.

V isu a l S tu d io 6 .0

Visual Basic: MSChart Control

Sort Property (MSChart)


See Also Example Applies To

Returns or sets the type of sort order used in a pie chart.

S y n ta x

o b je c t.S o r t [ = type]

The S o rt property syntax has these parts:

P a rt D e s c r ip tio n

o b ject An o b je c t expression th a t evaluates to an o b je ct in th e Applies To list.

type In te g e r. A V tS o rtT ype co n sta n t used to describe th e plot so rt order.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa229071(v=vs.60).aspx 1/1
2. 1.2018 Sorted Property (ListView Control)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


V isu a l S tu d io 6 .0

Sorted Property (ListView Control)


See Also Example Applies To

Returns or sets a value that determ ines w hether items in a collection are sorted.

S y n ta x

o b je c t.S o r te d [= boolean ]

The S o rte d property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

b o o lea n A Boolean expression specifying w hether the objects are sorted, as described in Settings.

S e ttin g s

The settings for b o o lea n are:

S e ttin g D e scrip tio n

T ru e The items are sorted alphabetically. For the L is tV ie w control, items are sorted according to the S o rtO rd e r
property.

False The items are not sorted.

R e m a rks

For the L istV ie w control, the So rte d property must be set to T ru e for the settings in the S o rtO rd e r and S o rtK e y properties
to take effect. Each tim e the coordinates of a L istIte m change, the S o rte d property is set to False.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa259699(v=vs.60).aspx 1/1
2. 1.2018 SortKey, SortOrder, Sorted P, ColumnClick Event Example

Visual Basic: Windows Controls


SortKey, SortOrder, Sorted Properties,
ColumnClick Event Example
This exam ple adds three C o lu m n H e a d e r objects to a L is tV ie w control and populates the control with the Publishers records
of the Biblio.m db database. An array of two O p tio n B u tto n controls offers the two choices for sorting records. W hen you
click on a C o lu m n H e a d e r, the L istV ie w control is sorted according to the S o rtO rd e r property, as determ ined by the
O p tio n B u tto n s. To try the exam ple, place a L is tV ie w and a control array of two O p tio n B u tto n controls on a form and paste
the code into the form's Declarations section. Run the exam ple and click on the C o lu m n H e a d e rs to sort, and click on the
O p tio n B u tto n to switch the S o rtO rd e r property.

N o te The exam ple will not run unless you add a reference to the M icrosoft DAO 3.51 Object Library by using the References
com mand on the Tools menu.

Private Sub Option1_Click(Index as Integer)


' These OptionButtons offer two choices: Ascending (Index 0),
' and Descending (Index 1). Clicking on one of these
' sets the SortOrder for the ListView control.
ListViewl.SortOrder = Index
ListViewl.Sorted = True ' Sort the List.
End Sub

Private Sub Form_Load()


' Create an object variable for the ColumnHeader object.
Dim clmX As ColumnHeader
' Add ColumnHeaders. The width of the columns is the width
' of the control divided by the number of ColumnHeader objects.
Set clmX = ListViewl.ColumnHeaders. _
Add(, , "Company", ListViewl.Width / 3)
Set clmX = ListViewl.ColumnHeaders. _
Add(, , "Address", ListViewl.Width / 3)
Set clmX = ListViewl.ColumnHeaders. _
Add(, , "Phone", ListViewl.Width / 3)

ListViewl.BorderStyle = ccFixedSingle ' Set BorderStyle property.


ListViewl.View = lvwReport ' Set View property to Report.

' Label OptionButton controls with SortOrder options.


Optionl(0).Caption = "Ascending (A-Z)"
Optionl(l).Caption = "Descending (Z-A)"
ListViewl.SortOrder = lvwAscending ' Sort ascending.

' Create object variables for the Data Access objects.


Dim myDb As Database, myRs As Recordset
' Set the Database to the BIBLIO.MDB database.
Set myDb = DBEngine.Workspaces(0).OpenDatabase("BIBLIO.MDB")
' Set the recordset to the Publishers table.
Set myRs = myDb.OpenRecordset("Publishers", dbOpenDynaset)

' Create a variable to add ListItem objects.


Dim itmX As ListItem

https://msdn.microsoft.com/en-us/library/aa259704(v=vs.60).aspx 1/2
2. 1.2018 SortKey, SortOrder, Sorted P, ColumnClick Event Example

' While the record is not the last record, add a ListItem object.
' Use the Name field for the ListItem object's text.
' Use the Address field for the ListItem object's subitem(1).
' Use the Phone field for the ListItem object's subitem(2).

While Not myRs.EOF


Set itmX = ListView1.ListItems.Add(, , CStr(myRs!Name))

' If the Address field is not Null, set subitem 1 to the field.
If Not IsNull(myRs!Address) Then
itmX.SubItems(1) = CStr(myRs!Address) ' Address field.
End If

' If the Phone field is not Null, set subitem 2 to the field.
If Not IsNull(myRs!Telephone) Then
itmX.SubItems(2) = myRs!Telephone ' Phone field.
End If

myRs.MoveNext ' Move to next record.


Wend
End Sub

Private Sub ListView1_ColumnClick(ByVal ColumnHeader As ColumnHeader)


' When a ColumnHeader object is clicked, the ListView control is
' sorted by the subitems of that column.
' Set the SortKey to the Index of the ColumnHeader - 1
ListView1.SortKey = ColumnHeader.Index - 1
' Set Sorted to True to sort the list.
ListView1.Sorted = True
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259704(v=vs.60).aspx 2/2
2. 1.2018 Sorted Property (TreeView Control)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


V isu a l S tu d io 6 .0

Sorted Property (TreeView Control)


See Also Example Applies To

• Returns or sets a value that determ ines w hether the child nodes of a N o de object are sorted alphabetically.

• Returns or sets a value that determ ines w hether the root level nodes of a T re e V ie w control are sorted alphabetically.

S y n ta x

o b j e c t .Sorted [ = boolean]

The S o rte d property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

b o o lea n A Boolean expression specifying w hether the N ode objects are sorted, as described in Settings.

S e ttin g s

The settings for b o o lea n are:

S e ttin g D e scrip tio n

T ru e The N o d e objects are sorted alphabetically by their T e x t property. N o de objects w hose T e x t property begins
with a num ber are sorted as strings, with the first digit determ ining the initial position in the sort, and
subsequent digits determ ining sub-sorting.

False The N o d e objects are not sorted.

R e m a rks

The S o rte d property can be used in tw o ways: first, to sort the N o de objects at the root (top) level of a T re e V ie w control
and, second, to sort the im m ediate children of any individual N o de object. For exam ple, the following code sorts the root
nodes of a T re e V ie w control:

https://msdn.microsoft.com/en-us/library/aa259700(v=vs.60).aspx 1/2
2. 1.2018 Sorted Property (TreeView Control)

Private Sub Command1_Click()


TreeView1.Sorted = True ' Top level Node objects are sorted.
End Sub

The next exam ple shows how to set the S o rte d property for a N o de object as it is created:

Private Sub Form_Load()


Dim nodX As Node
Set nodX = TreeView1.Nodes.Add(JJ/'Parent Node")
nodX.Sorted = True
End Sub

Setting the So rte d property to T ru e sorts the current N o des collection only. W hen you add new N o de objects to a
T re e V ie w control, you must set the S o rte d property to T ru e again to sort the added N o d e objects.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259700(v=vs.60).aspx 2/2
2. 1.2018 Sorted Property (Node Object) Example

Visual Basic: Windows Controls


Sorted Property (TreeView Control) Example
This exam ple adds several N o de objects to a tree. W hen you click a N ode, you are asked if you want to sort the N ode. To try
the exam ple, place a T re e V ie w control on a form and paste the code into the form's Declarations section. Run the exam ple,
and click a N o de to sort it.

Private Sub Form_Load()


' Create a tree with several unsorted Node objects.
Dim nodX As Node
Set nodX = TreeView1.Nodes.Add(, , , "Adam")
Set nodX = TreeView1.Nodes.Add(1, tvwChild, "z", "Zachariah")
Set nodX = TreeView1.Nodes.Add(1, tvwChild, , "Noah")
Set nodX = TreeView1.Nodes.Add(1, tvwChild, , "Abraham")
Set nodX = TreeView1.Nodes.Add("z", tvwChild, , "Stan")
Set nodX = TreeView1.Nodes.Add("z", tvwChild, , "Paul")
Set nodX = TreeView1.Nodes.Add("z", tvwChild, "f", "Frances")
Set nodX = TreeView1.Nodes.Add("f", tvwChild, , "Julie")
Set nodX = TreeView1.Nodes.Add("f", tvwChild, "c", "Carol")
Set nodX = TreeView1.Nodes.Add("f", tvwChild, , "Barry")
Set nodX = TreeView1.Nodes.Add("c", tvwChild, , "Yale")
Set nodX = TreeView1.Nodes.Add("c", tvwChild, , "Harvard")
nodX.EnsureVisible
End Sub

Private Sub TreeView1_NodeClick(ByVal Node As Node)


Dim answer As Integer
' Check if there are children nodes.
If Node.Children > 1 Then ' There are more than one children nodes.
answer = MsgBox("Sort this node?", vbYesNo) ' Prompt user.
If answer = vbYes Then ' User wants to sort.
Node.Sorted = True
End If
End If
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259701(v=vs.60).aspx 1/1
2. 1.2018 Sorted Property

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

Sorted Property
See Also Example Applies To

Returns a value indicating w hether the elem ents of a control are autom atically sorted alphabetically.

S y n ta x

object.Sorted

The o b je c t placeholder represents an object expression that evaluates to an object in the Applies To list.

R e tu rn V a lu e s

The S o rte d property return values are:

S e ttin g D e scrip tio n

T ru e List items are sorted by character code order.

False (Default) List items aren't sorted alphabetically.

R e m a rks

W hen this property is T ru e , Visual Basic handles almost all necessary string processing to maintain alphabetic order,
including changing the index num bers for items as required by the addition or removal of items.

N o te Using the A d d Ite m method to add an elem ent to a specific location in the list m ay violate the sort order, and
subsequent additions may not be correctly sorted.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445697(v=vs.60).aspx 1/1
2. 1.2018 SortKey Property (ListView Control)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


V isu a l S tu d io 6 .0

SortKey Property (ListView Control)


See Also Example Applies To

Returns or sets a value that determ ines how the L istIte m objects in a L is tV ie w control are sorted.

S y n ta x

o b j e c t .SortKey [= integer]

The S o rtK e y property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to a L is tV ie w control.

in te g e r An integer specifying the sort key, as described in Settings.

S e ttin g s

The settings for in te g e r are:

S e ttin g D e scrip tio n

0 Sort using the ListIte m object's T e x t property.

>1 Sort using the subitem w hose collection index is specified here.

R e m a rks

The S o rte d property must be set to T ru e before the change takes place.

It is com mon to sort a list when the column header is clicked. For this reason, the S o rtK e y property is com m only included in
the C o lu m n C lic k event to sort the list using the clicked colum n, as determ ined by the sort key, and dem onstrated in the
following exam ple:

Private Sub ListView1_ColumnClick (ByVal ColumnHeader as ColumnHeader)


ListView1.SortKey=ColumnHeader.Index-1
End Sub

https://msdn.microsoft.com/en-us/Nbrary/aa259702(v=vs.60).aspx 1/2
2. 1.2018 SortKey, SortOrder, Sorted P, ColumnClick Event Example

Visual Basic: Windows Controls


SortKey, SortOrder, Sorted Properties,
ColumnClick Event Example
This exam ple adds three C o lu m n H e a d e r objects to a L is tV ie w control and populates the control with the Publishers records
of the Biblio.m db database. An array of two O p tio n B u tto n controls offers the two choices for sorting records. W hen you
click on a C o lu m n H e a d e r, the L istV ie w control is sorted according to the S o rtO rd e r property, as determ ined by the
O p tio n B u tto n s. To try the exam ple, place a L is tV ie w and a control array of two O p tio n B u tto n controls on a form and paste
the code into the form's Declarations section. Run the exam ple and click on the C o lu m n H e a d e rs to sort, and click on the
O p tio n B u tto n to switch the S o rtO rd e r property.

N o te The exam ple will not run unless you add a reference to the M icrosoft DAO 3.51 Object Library by using the References
com mand on the Tools menu.

Private Sub Option1_Click(Index as Integer)


' These OptionButtons offer two choices: Ascending (Index 0),
' and Descending (Index 1). Clicking on one of these
' sets the SortOrder for the ListView control.
ListViewl.SortOrder = Index
ListViewl.Sorted = True ' Sort the List.
End Sub

Private Sub Form_Load()


' Create an object variable for the ColumnHeader object.
Dim clmX As ColumnHeader
' Add ColumnHeaders. The width of the columns is the width
' of the control divided by the number of ColumnHeader objects.
Set clmX = ListViewl.ColumnHeaders. _
Add(, , "Company", ListViewl.Width / 3)
Set clmX = ListViewl.ColumnHeaders. _
Add(, , "Address", ListViewl.Width / 3)
Set clmX = ListViewl.ColumnHeaders. _
Add(, , "Phone", ListViewl.Width / 3)

ListViewl.BorderStyle = ccFixedSingle ' Set BorderStyle property.


ListViewl.View = lvwReport ' Set View property to Report.

' Label OptionButton controls with SortOrder options.


Optionl(0).Caption = "Ascending (A-Z)"
Optionl(l).Caption = "Descending (Z-A)"
ListViewl.SortOrder = lvwAscending ' Sort ascending.

' Create object variables for the Data Access objects.


Dim myDb As Database, myRs As Recordset
' Set the Database to the BIBLIO.MDB database.
Set myDb = DBEngine.Workspaces(0).OpenDatabase("BIBLIO.MDB")
' Set the recordset to the Publishers table.
Set myRs = myDb.OpenRecordset("Publishers", dbOpenDynaset)

' Create a variable to add ListItem objects.


Dim itmX As ListItem

https://msdn.microsoft.com/en-us/library/aa259704(v=vs.60).aspx 1/2
2. 1.2018 SortKey, SortOrder, Sorted P, ColumnClick Event Example

' While the record is not the last record, add a ListItem object.
' Use the Name field for the ListItem object's text.
' Use the Address field for the ListItem object's subitem(1).
' Use the Phone field for the ListItem object's subitem(2).

While Not myRs.EOF


Set itmX = ListView1.ListItems.Add(, , CStr(myRs!Name))

' If the Address field is not Null, set subitem 1 to the field.
If Not IsNull(myRs!Address) Then
itmX.SubItems(1) = CStr(myRs!Address) ' Address field.
End If

' If the Phone field is not Null, set subitem 2 to the field.
If Not IsNull(myRs!Telephone) Then
itmX.SubItems(2) = myRs!Telephone ' Phone field.
End If

myRs.MoveNext ' Move to next record.


Wend
End Sub

Private Sub ListView1_ColumnClick(ByVal ColumnHeader As ColumnHeader)


' When a ColumnHeader object is clicked, the ListView control is
' sorted by the subitems of that column.
' Set the SortKey to the Index of the ColumnHeader - 1
ListView1.SortKey = ColumnHeader.Index - 1
' Set Sorted to True to sort the list.
ListView1.Sorted = True
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259704(v=vs.60).aspx 2/2
2. 1.2018 SortOrder Property (ListView Control)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


V isu a l S tu d io 6 .0

SortOrder Property (ListView Control)


See Also Example Applies To

Returns or sets a value that determ ines w hether L istIte m objects in a L is tV ie w control are sorted in ascending or descending
order.

S y n ta x

o b j e c t .SortOrder [= integer]

The S o rtO rd e r property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to a L is tV ie w control.

in te g e r An integer specifying the type of sort order, as described in Settings.

S e ttin g s

The settings for in te g e r are:

C o n sta n t V a lu e D e scrip tio n

lvw A sc e n d in g 0 (Default) Ascending order. Sorts from the beginning of the alphabet (A-Z) or the earliest date.
Num bers are sorted as strings, with the first digit determ ining the initial position in the sort,
and subsequent digits determ ining sub-sorting.

lv w D e sce n d in g 1 Descending order. Sorts from the end of the alphabet (Z-A) or the latest date. Num bers are
sorted as strings, with the first digit determ ining the initial position in the sort, and
subsequent digits determ ining sub-sorting.

R e m a rks

The S o rte d property must be set to T ru e before a list will be sorted in the order specified by So rtO rd e r.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259703(v=vs.60).aspx 1/1
2. 1.2018 SortKey, SortOrder, Sorted P, ColumnClick Event Example

Visual Basic: Windows Controls


SortKey, SortOrder, Sorted Properties,
ColumnClick Event Example
This exam ple adds three C o lu m n H e a d e r objects to a L is tV ie w control and populates the control with the Publishers records
of the Biblio.m db database. An array of two O p tio n B u tto n controls offers the two choices for sorting records. W hen you
click on a C o lu m n H e a d e r, the L istV ie w control is sorted according to the S o rtO rd e r property, as determ ined by the
O p tio n B u tto n s. To try the exam ple, place a L is tV ie w and a control array of two O p tio n B u tto n controls on a form and paste
the code into the form's Declarations section. Run the exam ple and click on the C o lu m n H e a d e rs to sort, and click on the
O p tio n B u tto n to switch the S o rtO rd e r property.

N o te The exam ple will not run unless you add a reference to the M icrosoft DAO 3.51 Object Library by using the References
com mand on the Tools menu.

Private Sub Option1_Click(Index as Integer)


' These OptionButtons offer two choices: Ascending (Index 0),
' and Descending (Index 1). Clicking on one of these
' sets the SortOrder for the ListView control.
ListViewl.SortOrder = Index
ListViewl.Sorted = True ' Sort the List.
End Sub

Private Sub Form_Load()


' Create an object variable for the ColumnHeader object.
Dim clmX As ColumnHeader
' Add ColumnHeaders. The width of the columns is the width
' of the control divided by the number of ColumnHeader objects.
Set clmX = ListViewl.ColumnHeaders. _
Add(, , "Company", ListViewl.Width / 3)
Set clmX = ListViewl.ColumnHeaders. _
Add(, , "Address", ListViewl.Width / 3)
Set clmX = ListViewl.ColumnHeaders. _
Add(, , "Phone", ListViewl.Width / 3)

ListViewl.BorderStyle = ccFixedSingle ' Set BorderStyle property.


ListViewl.View = lvwReport ' Set View property to Report.

' Label OptionButton controls with SortOrder options.


Optionl(0).Caption = "Ascending (A-Z)"
Optionl(l).Caption = "Descending (Z-A)"
ListViewl.SortOrder = lvwAscending ' Sort ascending.

' Create object variables for the Data Access objects.


Dim myDb As Database, myRs As Recordset
' Set the Database to the BIBLIO.MDB database.
Set myDb = DBEngine.Workspaces(0).OpenDatabase("BIBLIO.MDB")
' Set the recordset to the Publishers table.
Set myRs = myDb.OpenRecordset("Publishers", dbOpenDynaset)

' Create a variable to add ListItem objects.


Dim itmX As ListItem

https://msdn.microsoft.com/en-us/library/aa259704(v=vs.60).aspx 1/2
2. 1.2018 SortKey, SortOrder, Sorted P, ColumnClick Event Example

' While the record is not the last record, add a ListItem object.
' Use the Name field for the ListItem object's text.
' Use the Address field for the ListItem object's subitem(1).
' Use the Phone field for the ListItem object's subitem(2).

While Not myRs.EOF


Set itmX = ListView1.ListItems.Add(, , CStr(myRs!Name))

' If the Address field is not Null, set subitem 1 to the field.
If Not IsNull(myRs!Address) Then
itmX.SubItems(1) = CStr(myRs!Address) ' Address field.
End If

' If the Phone field is not Null, set subitem 2 to the field.
If Not IsNull(myRs!Telephone) Then
itmX.SubItems(2) = myRs!Telephone ' Phone field.
End If

myRs.MoveNext ' Move to next record.


Wend
End Sub

Private Sub ListView1_ColumnClick(ByVal ColumnHeader As ColumnHeader)


' When a ColumnHeader object is clicked, the ListView control is
' sorted by the subitems of that column.
' Set the SortKey to the Index of the ColumnHeader - 1
ListView1.SortKey = ColumnHeader.Index - 1
' Set Sorted to True to sort the list.
ListView1.Sorted = True
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259704(v=vs.60).aspx 2/2
2. 1.2018 Source Property (Remote Data) (RemoteData Control)

This documentation is archived and is not being maintained.

Visual Basic: RDO Data Control


V isu a l S tu d io 6 .0

Source Property (Remote Data)


See Also Example Applies To

Returns a value that indicates the source of a remote data access error.

S y n ta x

o b je c t.S o u r c e

The o b je c t placeholder represents an object expression that evaluates to an object in the Applies To list.

R e tu rn V a lu e s

The So u rce property return value is a string expression as described in Remarks.

R e m a rks

W hen an error occurs during an ODBC operation, an rd o E rro r object is appended to the rd o E rro rs collection. If the error
occurred w ithin RDO, the return value begins with "M SRDO20". The object class that caused the error might also be
appended to the value of the So u rce property.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263035(v=vs.60).aspx 1/1
2. 1.2018 Source Property (Visual Basic for Applications)

This documentation is archived and is not being maintained.

Visual Basic for Applications Reference


V isu a l S tu d io 6 .0

Source Property
See Also Example Applies To Specifics

Returns or sets a string expression specifying the name of the object or application that originally generated the error.
Read/write.

R e m a rks

The So u rce property specifies a string expression representing the object that generated the error; the expression is usually
the object's class name or program m atic ID. Use So u rce to provide inform ation when yo ur code is unable to handle an error
generated in an accessed object. For exam ple, if you access M icrosoft Excel and it generates a D iv is io n by z e ro error,
M icrosoft Excel sets E rr.N u m b e r to its error code for that error and sets So u rce to Excel.Application.

W hen generating an error from code, So u rce is yo ur applications program m atic ID. For class m odules, So u rce should
contain a name having the form p ro je ct.cla ss. W hen an unexpected error occurs in yo ur code, the So u rce property is
autom atically filled in. For errors in a standard m odule, So u rce contains the project name. For errors in a class module,
So u rce contains a name with the p ro je ct.cla ss form.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa265872(v=vs.60).aspx 1/1
2. 1.2018 Source Property Example

Visual Basic for Applications Reference


Source Property Example
This exam ple assigns the Program m atic ID of an Autom ation object created in Visual Basic to the variable MyObjectID, and
then assigns that to the So u rce property of the E rr object when it generates an error with the R aise method. W hen handling
errors, you should not use the So u rce property (or any E rr properties other than N u m b er) program m atically. The only valid
use of properties other than N u m b e r is for displaying rich inform ation to an end user in cases w here you can't handle an
error. The exam ple assum es that App and MyClass are valid references.

Dim MyClass, MyObjectID, MyHelpFile, MyHelpContext


' An object of type MyClass generates an error and fills all Err object
' properties, including Source, which receives MyObjectID, which is a
' combination of the Title property of the App object and the Name
' property of the MyClass object.
MyObjectID = App.Title & "." & MyClass.Name
Err.Raise Number := vbObjectError + 894, Source := MyObjectID, _
Description := "Was not able to complete your task", _
HelpFile := MyHelpFile, HelpContext := MyHelpContext

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa265883(v=vs.60).aspx 1/1
2. 1.2018 Source Property

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

Source Property
See Also Example Applies To

Returns the source of an error.

S y n ta x

object. So u rce

The o b je c t placeholder represents an object expression that evaluates to an object in the Applies To list.

R e tu rn T y p e

S trin g

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445701(v=vs.60).aspx 1/1
2. 1.2018 SourceColumn Property (Remote Data) (RemoteData Control)

This documentation is archived and is not being maintained.

Visual Basic: RDO Data Control


V isu a l S tu d io 6 .0

SourceColumn Property (Remote Data)


See Also Example Applies To

The So u rce C o lu m n property returns a value that indicates the name of the column that is the original source of the data for
an rd o C o lu m n object.

This property is not available at design tim e and is read-write at run tim e.

S y n ta x

ob/ect.SourceColum n

The o b je c t placeholder is an object expression that evaluates to an object in the Applies To list.

R e tu rn V a lu e s

The S o u rce C o lu m n property returns a string expression that specifies the name of the column that is the source of data.

R e m a rks

This property indicates the original column name associated with an rd o C o lu m n object. For exam ple, you could use this
property to determ ine the original source of the data in a query column w hose name is unrelated to the name of the column
in the underlying table.

For columns in rd o R e su ltse t objects, the So u rce C o lu m n and S o u rc e T a b le properties return the column name and table
name of the base table or the colum ns and table(s) used to define the query.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263036(v=vs.60).aspx 1/1
2. 1.2018 Name Property Example (RDO) (RemoteData Control)

Visual Basic: RDO Data Control


Name Property Example (RDO)
The following exam ple illustrates use of the Name property to expose the names of all tables associated with a chosen
database, the names of each column for the selected table, and specific type inform ation about a selected column. This
application uses three L is tb o x controls and a C o m m an d button control.

O p tio n E x p l i c i t
Dim en As rd o E n v iro n m e n t
Dim cn As rd o C o n n e c tio n
Dim rs As r d o R e s u lt s e t
Dim tb As rd o T a b le
Dim cl As rdoColumn
Dim er As rd o E rro r

P r iv a t e Sub C o m m an d 1 _C lick()
S e t en = r d o E n g in e .rd o E n v iro n m e n t s (0 )

S e t cn = e n .O p e n C o n n e ctio n (d sN a m e := "W o rkD B "J


p ro m p t:= rd D riv e rN o P ro m p t, _
C o n n e c t:= " U id =;p w d = .;d a ta b a se = P u b s")

F o r Each tb In c n .r d o T a b le s
L is t 1 .A d d It e m tb.N am e
N ext
L is t 1 .L is t I n d e x = 1
End Sub

P r iv a t e Sub L i s t 1 _ C l i c k ( )
L is t 3 .E n a b le d = F a ls e
L is t 2 .C le a r
F o r Each c l In c n .r d o T a b le s ( ( L is t 1 ) ) .r d o C o lu m n s
L is t 2 .A d d It e m cl.N am e
N ext
L is t 3 .E n a b le d = T ru e
End Sub

P r iv a t e Sub L i s t 2 _ C l i c k ( )
L is t 3 .C le a r
W ith c n . r d o T a b l e s ( ( L i s t 1 ) ) . r d o C o l u m n s ( ( L i s t 2 ) )
L is t 3 .A d d It e m "S o u rc e C o lu m n :" & .So urceC o lum n
L is t 3 .A d d It e m "S o u rc e T a b l e :" & .S o u rc e T a b le
L is t 3 .A d d It e m " T y p e :" & .T yp e
L is t 3 .A d d It e m " S i z e : " & .S i z e
L is t 3 .A d d It e m " O r d in a l P o s i t i o n : " _
& .O r d in a lP o s it io n
L is t 3 .A d d It e m " A llo w Z e ro Length ?" _
& .A llo w Z e ro L e n g th
L is t 3 .A d d It e m " R e q u ir e d :" & .R e q u ire d
L is t 3 .A d d It e m "Chunk R e q u ir e d ? :" & .C h u n k R e q u ire d
L is t 3 .A d d It e m " U p d a t a b le ? :" & .U p d a ta b le
End W ith
End Sub

https://msdn.microsoft.com/en-us/library/aa229971(v=vs.60).aspx 1/2
2. 1.2018 SourceDoc Property

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

SourceDoc Property
See Also Example Applies To

Returns or sets the filenam e to use when you create an object.

N o te You set the So u rce D o c property for com patibility with the A ctio n property in earlier versions. For current
functionality, use the C re a te Em b e d and C re a te L in k m ethods.

S y n ta x

o b je c t.S o u r c e D o c [ = n am e]

The So u rce D o c property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

nam e A string expression specifying a filenam e.

R e m a rks

Use the S o u rce D o c property to specify the file to be linked w hen creating a linked object using the A ctio n property. Use the
S o u rc e Ite m property to specify data w ithin the file to be linked.

W hen creating an embedded object using the A ctio n property, if the So u rce D o c property is set to a valid filenam e, an
embedded object is created using the specified file as a tem plate.

W hen a linked object is created, the S o u rce Ite m property is concatenated to the So u rce D o c property. At run tim e, the
S o u rc e Ite m property returns a zero-length string (""), and the So u rce D o c property returns the entire path to the linked file,
followed by an exclam ation point (!) or a backslash (\), followed by the S o u rce Ite m . For example:

" C\W O RK\Q TR1\REVEN U E.XLS!R1C1:R30C15"

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445698(v=vs.60).aspx 1/1
2. 1.2018 SourceFile Property (DHTML Page Designer)

This documentation is archived and is not being maintained.

Visual Basic: Page Designer


V isu a l S tu d io 6 .0

SourceFile Property
See Also Example Applies To

Sets the path from which the page designer should load the specified HTML file into the Detail pane of the designer. Not
available at run time.

R e m a rks

This property can be set by accessing the Page Properties dialog box and specifying an existing file to use as the source for
the page, or you can set it directly in the Properties w indow by accessing the D H T M L P a g e object for yo ur designer. The
system checks to determ ine if you have entered a valid path to the file, then im ports the HTML page's contents into the
designer. The value of the B u ild F ile property is initially set to the same path as the S o u rc e F ile property.

You must enter an absolute path to the source HTML file in this property, indicating the full drive letter and directory
structure in which the com piled file will be placed. If you later share your project with another developer w ho has a different
directory structure or drive name than you originally used, the second developer will need to m odify the value of the
S o u rc e F ile property to reflect the location of the HTML file on his machine. Run-time users are not affected by this
restriction.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa228626(v=vs.60).aspx 1/1
2. 1.2018 Sourceltem Property

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

SourceItem Property
See Also Example Applies To

Returns or sets the data w ithin the file to be linked w hen you create a linked object.

S y n ta x

ob/ect.SourceItem [ = strin g]

The S o u rc e lte m property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

strin g A string expression specifying the data to be linked.

R e m a rks

O L E T y p e A llo w e d must be set to 0 (Linked) or 2 (Either) w hen using this property. Use the So u rce D o c property to specify
the file to link.

Each object uses its own syntax to describe units of data. To set this property, specify a unit of data recognized by the object.
For exam ple, w hen you link to M icrosoft Excel, specify the S o u rc e lte m using a cell or cell-range reference such as R1C1 or
R3C4:R9C22, or a named range such as Revenues.

To determ ine the syntax to describe a unit of data for an object, see the docum entation for the application that created the
object.

N o te You m ay be able to determ ine this syntax by creating a linked object at design tim e using the Paste Special com mand
(click the O LE container control with the right mouse button). Once the object is created, select the S o u rce D o c property in
the Properties w indow and look at the string in the Settings box. For most objects, this string contains a path to the linked
file, followed by an exclam ation point (!) or a backslash (\) and the syntax for the linked data.

W hen a linked object is created, the S o u rc e lte m property is concatenated to the So u rce D o c property. At run tim e, the
S o u rc e lte m property returns a zero-length string (""), and the So u rce D o c property returns the entire path to the linked file,
followed by an exclam ation point (!) or a backslash (\), followed by the S o u rc e lte m . For example:

"C :\W O R K\Q TR 1\R EV EN U E.XLS!R 1C 1:R 30C 15"

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445699(v=vs.60).aspx 1/1
2. 1.2018 SourceOfData Property

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

SourceOfData Property
See Also Example Applies To

Specifies the source of the D EC o n n e ctio n object definition.

S y n ta x

ob/ect.SourceO fD ata [= value]

The S o u rc e O fD a ta property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an item in the Applies To list.

value A constant or value that specifies the source of data for the D E C o n n e ctio n object, as described in Settings.

S e ttin g s

The settings for va lue are:

C o n sta n t D e scrip tio n

d e O L E D B C o n n e c tio n S trin g Use OLE DB Connection String. The source is an OLE DB connection string.

d e U se O D B C D a ta S o u rce Use ODBC Datasource. Default. The source is a connection string.

d e O L E D B F ile Use OLE DB File. The source is an OLE DB file.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445700(v=vs.60).aspx 1/1
2. 1.2018 SourceTable Property (RemoteData Control)

This documentation is archived and is not being maintained.

Visual Basic: RDO Data Control


V isu a l S tu d io 6 .0

SourceTable Property
See Also Example Applies To

S o u rc e T a b le returns a value that indicates the name of the table that is the original source of the data for an rd o C o lu m n
object.

This property is not available at design tim e and is read-only at run tim e.

S y n ta x

ob/ect.SourceTable

The o b je c t placeholder is an object expression that evaluates to an object in the Applies To list.

R e tu rn V a lu e s

The S o u rc e T a b le property returns a string expression that specifies the name of the table that is the source of data.

R e m a rks

This property indicates the original table name associated with an rd o C o lu m n object. For exam ple, you could use these
properties to determ ine the original source of the data in a query column whose name is unrelated to the name of the
column in the underlying table.

For columns in rd o R e su ltse t objects, the So u rce C o lu m n and S o u rc e T a b le properties return the column name and table
name of the base table or the colum ns and table(s) used to define the query.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263037(v=vs.60).aspx 1/1
2. 1.2018 Name Property Example (RDO) (RemoteData Control)

Visual Basic: RDO Data Control


Name Property Example (RDO)
The following exam ple illustrates use of the Name property to expose the names of all tables associated with a chosen
database, the names of each column for the selected table, and specific type inform ation about a selected column. This
application uses three L is tb o x controls and a C o m m an d button control.

O p tio n E x p l i c i t
Dim en As rd o E n v iro n m e n t
Dim cn As rd o C o n n e c tio n
Dim rs As r d o R e s u lt s e t
Dim tb As rd o T a b le
Dim cl As rdoColumn
Dim er As rd o E rro r

P r iv a t e Sub C o m m an d 1 _C lick()
S e t en = r d o E n g in e .rd o E n v iro n m e n t s (0 )

S e t cn = e n .O p e n C o n n e ctio n (d sN a m e := "W o rkD B "J _


p ro m p t:= rd D riv e rN o P ro m p t, _
C o n n e c t:= " U id =;p w d = .;d a ta b a se = P u b s")

F o r Each tb In c n .r d o T a b le s
L is t 1 .A d d It e m tb.N am e
N ext
L is t 1 .L is t I n d e x = 1
End Sub

P r iv a t e Sub L i s t 1 _ C l i c k ( )
L is t 3 .E n a b le d = F a ls e
L is t 2 .C le a r
F o r Each c l In c n .r d o T a b le s ( ( L is t 1 ) ) .r d o C o lu m n s
L is t 2 .A d d It e m cl.N am e
N ext
L is t 3 .E n a b le d = T ru e
End Sub

P r iv a t e Sub L i s t 2 _ C l i c k ( )
L is t 3 .C le a r
W ith c n . r d o T a b l e s ( ( L i s t 1 ) ) . r d o C o l u m n s ( ( L i s t 2 ) )
L is t 3 .A d d It e m "S o u rc e C o lu m n :" & .So urceC o lum n
L is t 3 .A d d It e m "S o u rc e T a b l e :" & .S o u rc e T a b le
L is t 3 .A d d It e m " T y p e :" & .T yp e
L is t 3 .A d d It e m " S i z e : " & .S i z e
L is t 3 .A d d It e m " O r d in a l P o s i t i o n : " _
& .O r d in a lP o s it io n
L is t 3 .A d d It e m " A llo w Z e ro Length ?" _
& .A llo w Z e ro L e n g th
L is t 3 .A d d It e m " R e q u ir e d :" & .R e q u ire d
L is t 3 .A d d It e m "Chunk R e q u ir e d ? :" & .C h u n k R e q u ire d
L is t 3 .A d d It e m " U p d a t a b le ? :" & .U p d a ta b le
End W ith
End Sub

https://msdn.microsoft.com/en-us/library/aa229971(v=vs.60).aspx 1/2
2. 1.2018 SpaceColor Property

This documentation is archived and is not being maintained.

V isu a l S tu d io 6 .0

Visual Basic: MSChart Control

SpaceColor Property
See Also Example Applies To

Returns a reference to a V tC o lo r object that specifies the color used fill the space between double frames around a chart
element.

S y n ta x

object.SpaceColor

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

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa229072(v=vs.60).aspx 1/1
2. 1.2018 Split Property (DataGrid Control)

This documentation is archived and is not being maintained.

Visual Basic: DataGrid Control


V isu a l S tu d io 6 .0

Split Property
See Also Example Applies To

Sets or returns the index of the current split. Not available at design time.

S y n ta x

o b je c t.S p lit [= value]

The S p lit property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

value A Long that specifies the index of the current split, as described in Remarks.

R e m a rks

The S p lit property specifies a zero-based index of the current split.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa227386(v=vs.60).aspx 1/1
2. 1.2018 Splits Property (DataGrid Control)

This documentation is archived and is not being maintained.

Visual Basic: DataGrid Control


V isu a l S tu d io 6 .0

Splits Property
See Also Example Applies To

Returns a collection of S p lit objects. Not available at design time.

S y n ta x

o b je c t.S p lits

The S p lits property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa227387(v=vs.60).aspx 1/1
2. 1.2018 SQL Property (Remote Data) (RemoteData Control)

This documentation is archived and is not being maintained.

Visual Basic: RDO Data Control


V isu a l S tu d io 6 .0

SQL Property
See Also Example Applies To

Returns or sets the SQL statem ent that defines the query executed by an rd o Q u e ry o b je ct or a R e m o te D a ta control.

S y n ta x

o b je c t.S Q L [= value]

The SQ L property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

value A string expression that contains a value as described in Settings. (Data type is String.)

S e ttin g s

The settings for va lue are:

S e ttin g D e scrip tio n

A valid SQL An SQL query using syntax appropriate for the data source.
statem ent

A stored The name of a stored procedure supported by the data source preceded with the keyword
procedure "Execute".

An rd o Q u e ry The name of one of the rd o Q u e ry objects in the rd o C o n n e ctio n object's rd o Q u e rie s collection.

An rd o R e su ltse t The name of one of the rd o R e s u ltse t objects in the rd o C o n n e ctio n object's rd o R e su ltse ts
collection.

A table name The name of one of the populated rd o T a b le objects defined in the rd o C o n n e ctio n object's
rd o T a b le s collection.

R e m a rks

https://msdn.microsoft.com/en-us/library/aa263038(v=vs.60).aspx 1/3
2. 1.2018 SQL Property (Remote Data) (RemoteData Control)

The SQ L property contains the structured query language statem ent that determ ines how rows are selected, grouped, and
ordered w hen you execute a query. You can use a query to select rows to include in an rd o R e s u ltse t object. You can also
define action queries to m odify data w ithout returning rows.

You cannot provide a table name at design tim e for the SQ L property. However, you can either use a sim ple query like
SELECT * FROM <table>, or at runtim e, populate the rd o T a b le s collection and use one of the table names returned in the
collection. The rd o T a b le s collection is populated as soon as it is associated with an active connection and referenced.

The SQL syntax used in a query must conform to the SQL dialect as defined by the data source query processor. The SQL
dialect supported by the ODBC interface is defined by the X/Open standard. Generally, a driver scans an SQL statem ent
looking for specific escape sequences that are used to identify non-standard operands like tim estam p literals and functions.

W hen you need to return rows from a query, you generally provide a SELECT statem ent in the SQ L property. The SELECT
statem ent specifies:

• The name of each column to return or "*" to indicate all colum ns of the specified tables are to be returned.
Am biguous column names must be addressed to include the table name as needed. You can also specify aggregate
expressions to perform arithm etic or other functions on the colum ns selected.

• The name of each table that is to be searched for the inform ation requested. If you specify more than one table, you
must provide a W HERE clause to indicate which colum n(s) are used to cross-reference the inform ation in the tables.
Generally, these colum ns have the same name and meaning. For exam ple the Custom erID column in the Custom ers
table and the Orders table might be referenced.

• (Optionally) a W HERE clause to specify how to jo in the tables specified and how to limit or filter the num ber and types
of rows returned. You can use param eters in the W HERE clause to specify different sets of inform ation from query to
query.

• (Optionally) other clauses such as O RDER BY to set a particular order for the rows or GROUP BY to structure the rows
in related sets.

Each SQL dialect supports different syntax and different ancillary clauses. See the docum entation provided with your remote
server for more details.

S p e c ifyin g P a ra m e te rs

If the SQL statem ent includes question m ark param eter m arkers (?) for the query, you must provide these parameters before
you execute the query. Until you reset the param eters, the same param eter values are applied each tim e you execute the
query. To use the rd o P a ra m e te rs collection to manage SQL query param eters, you must include the "?" param eter m arker in
the SQL statem ent. Input, output, input/output and return value param eters must all be identified in this manner. In some
cases, you must use the D ire ctio n property to indicate how the param eter will be used.

N o te W hen executing stored procedures that do n o t require param eters, do not include the parenthesis in the SQL
statem ent. For exam ple, to execute the "MySP" procedure use the following syntax: { C a l l MySP }.

N o te W hen using M icrosoft SQL Server 6 as a data source, the ODBC driver autom atically sets the D ire ctio n property. You
also do not need to set the D ire ctio n property for input param eters, as this is the default setting.

If the user changes the param eter value, you can re-apply the param eter value and re-execute the query by using the
R e q u e ry method against the rd o R e su ltse t (MyRs).

Cpw (0) = T e x t 1 .T e x t
M yR s.R e q u e ry

You can also specify param eters in any SQL statem ent by concatenating the param eters to the SQL statem ent string. For
exam ple, to subm it a query using this technique, you can use the following code:

QSQL$ = "SELEC T * FROM A u th o rs WHERE Au_Lname = ' " _


& T e x t .T e x t & .......

https://msdn.microsoft.com/en-us/library/aa263038(v=vs.60).aspx 2/3
2. 1.2018 SQL Property (Remote Data) (RemoteData Control)

S e t CPw = c n .C r e a t e Q u e r y ( '" 'J QSQL$)


S e t MyRs = C p w .O p e n R e s u ltS e t()

In this case, the rd o P a ra m e te rs collection is n o t created and cannot be referenced. To change the query param eter, you
must rebuild the SQL statem ent with the new param eter value each tim e the query is executed, or before you use the
R e q u e ry method.

The SQL statem ent m ay include an O RDER BY clause to change the order of the rows returned by the rd o R e s u ltse t or a
W HERE clause to filter the rows.

N o te You can't use the rd o T a b le object names until the rd o T a b le s collection is referenced. W hen your code references the
rd o T a b le s collection by enum erating one or more of its m em bers, RDO queries the data source for table meta data. This
results in population of the rd o T a b le s collection. This means that you cannot sim ply provide a table name for the value
argum ent w ithout first enum erating the rd o T a b le s collection.

R e m o te D a ta C o n tro l

W hen used with the R e m o te D a ta control, the SQ L property specifies the source of the data rows accessible through bound
controls on yo ur form.

If you set the SQ L property to an SQL statem ent that returns rows or to the name of an existing rd o Q u e ry, all columns
returned by the rd o R e su ltse t are visible to the bound controls associated with the R e m o te D a ta control.

A fter changing the value of the SQ L property at run tim e, you must use the R e fre sh method to activate the change.

N o te W henever yo ur rd o Q u e ry or SQL statem ent returns a value from an expression, the column name of the expression is
determined by the wording of the SQL query. In most cases you'll want to alias expressions so you know the name of the
column to bind to the bound control.

Make sure each bound control has a valid setting for its D a ta F ie ld property. If you change the setting of a R e m o te D a ta
control's SQ L property and then use R e fre sh , the rd o R e s u ltse t identifies the new object. This m ay invalidate the D a ta Fie ld
settings of bound controls and cause a trappable error.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263038(v=vs.60).aspx 3/3
2. 1.2018 SQL Property Example (RemoteData Control)

Visual Basic: RDO Data Control


SQL Property Example
For exam ple, to execute a procedure that accepts two input param eters and returns a return value and an output parameter,
you can use the following code. The exam ple creates an rd o Q u e ry object w hose SQL property is set to the string specified
by QSQL$. This query calls a stored procedure that returns a return status, and an output argum ent as well as accepting two
input argum ents.

Dim Cqy as new rdoQ uery


Dim MyRs as r d o R e s u lt s e t
C q y.SQ L = " { ? = c a l l sp_M yProc ( ? , ?, ?) }"
C q y ( 0 ) .D ir e c t io n = rd R e tu rn V a lu e
C q y ( 1 ) .D ir e c t io n = rd P a ra m In p u t
C q y ( 2 ) .D ir e c t io n = rd P a ra m In p u t
C q y ( 3 ) .D ir e c t io n = rdParam O utput
C q y (1 ) = " V i c t o r i a "
C q y (0 ) = 21
S e t MyRs = C q y .O p e n R e s u ltS e t(rd O p e n F o rw a rd O n ly )

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263041(v=vs.60).aspx 1/1
2. 1.2018 SQLRetCode Property (Remote Data) (RemoteData Control)

This documentation is archived and is not being maintained.

Visual Basic: RDO Data Control


V isu a l S tu d io 6 .0

SQLRetCode Property (Remote Data)


See Also Example Applies To

Returns the ODBC error return code from the most recent RDO operation.

S y n ta x

o b je c t.S Q L R e tC o d e

The o b je c t placeholder represents an object expression that evaluates to an object in the Applies To list.

R e tu rn V a lu e s

The SQ LR e tC o d e property return value is a Long value that corresponds to one of the following constants:

C o n sta n t V a lu e D e scrip tio n

rd S Q LSu cce ss 0 The operation is successful.

rd S Q LS u c ce ssW ith In fo 1 The operation is successful, and additional inform ation is available.

rd S Q LN o D ataFo u n d 100 No additional data is available.

rd S Q L E rro r -1 An error occurred performing the operation.

rd S Q L In v a lid H a n d le -2 The handle supplied is invalid.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263039(v=vs.60).aspx 1/1
2. 1.2018 SQLState Property (Remote Data) (RemoteData Control)

This documentation is archived and is not being maintained.

Visual Basic: RDO Data Control


V isu a l S tu d io 6 .0

SQLState Property (Remote Data)


See Also Example Applies To

Returns a value corresponding to the type of error as defined by the X/Open and SQL Access Group SQL.

S y n ta x

o b je c t.S Q L S ta te

The o b je c t placeholder represents an object expression that evaluates to an object in the Applies To list.

R e tu rn V a lu e s

The S Q LS ta te return value is a five-character string expression, as described in Remarks.

R e m a rks

W hen an RDO operation returns an error, or com pletes an operation, the S Q LS ta te property of the rd o E rro r object is set. If
the error is not caused by ODBC or if no S Q LS ta te is available, the S Q L S ta te property returns an em pty string.

The character string value returned by the S Q LS ta te property consists of a tw o-character class value followed by a three-
character subclass value. A class value of "01" indicates a warning and is accom panied by a return code of
rd S Q L S u c ce ssW ith In fo .

Class values other than "01", except for the class "IM", indicate an error and are accom panied by a return code of
rd S Q LE rro r. The class "IM" is specific to w arnings and errors that derive from the im plem entation of ODBC itself. The
subclass "000" in any class is for im plem entation-defined conditions within the given class. The assignm ent of class and
subclass values is defined by A N SI SQL-92.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263040(v=vs.60).aspx 1/1
2. 1.2018 Stacking Property

This documentation is archived and is not being maintained.

V isu a l S tu d io 6 .0

Visual Basic: MSChart Control

Stacking Property
See Also Example Applies To

Sets a value that determ ines w hether all the series in the chart are stacked.

S y n ta x

o b je ctStackin g [ = boolean ]

The S ta c k in g property syntax has these parts:

P a rt D e s c rip tio n

o b ject An o b je ct expression th a t evaluates to an o b je ct in th e Applies To list.

boolean A Boolean expression th a t controls w h e th e r all ch a rt series are stacked, as described in


S ettings.

S e ttin g s

The settings for b o o lea n are:

S e ttin g D e s c rip tio n

T ru e All c h a rt series are stacked.

F a ls e (D e fa u lt) C h art series are no t stacked.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa229073(v=vs.60).aspx 1/1
2. 1.2018 StackOrder Property

This documentation is archived and is not being maintained.

V isu a l S tu d io 6 .0

Visual Basic: MSChart Control

StackOrder Property
See Also Example Applies To

Returns or sets in what position the current series is drawn if it is stacked with other series.

S y n ta x

o b ject.StackO rder [ = p o sitio n ]

The S ta c k O rd e r property syntax has these parts:

P a rt D e s c rip tio n

o b ject An o b je ct expression th a t evaluates to an o b je ct in th e Applies To list.

position In te g e r. The o rd e r o f th e series if stacked w ith o th e r series. Low er stack orders are on th e
b o tto m o f th e stack.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa229074(v=vs.60).aspx 1/1
2. 1.2018 StandardMethod Property

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

StandardMethod Property
See Also Example Applies To

Returns or sets the StandardM ethod attribute of a M e m b e r object.

S y n ta x

ob ject.StandardM etho d

The o b je c t placeholder represents an object expression that evaluates to an object in the Applies To list.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445704(v=vs.60).aspx 1/1
2. 1.2018 StandardSize Property

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

StandardSize Property
See Also Example Applies To

Sets the property page to a standard size.

S y n ta x

o b/ecf.StandardSize [= value]

The S ta n d a rd S iz e property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

value An integer expression specifying the type of m ouse pointer displayed, as described in Settings.

S e ttin g s

The settings for va lue are:

C o n sta n t V a lu e D e scrip tio n

C usto m 0 (Default) Size determ ined by the object.

Sm all 1 Sets the P ro p e rty P a g e S ta n d a rd S iz e to 101 pixels high by 375 pixels wide.

Larg e 2 Sets the P ro p e rty P a g e S ta n d a rd S iz e to 179 pixels high by 375 pixels wide.

R e m a rks

The S ta n d a rd S iz e property for property pages m ay not give the expected result w hen set to 1 - Small or 2 - Large. This
property only affects the size of the property page for the authors display driver and resolution. Unexpected results my occur
on other displays.

It is suggested that you use the default S ta n d a rd S iz e property value (0 - Custom) and treat a property page as you would
any other form.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445705(v=vs.60).aspx 1/1
2. 1.2018 Standing Property

This documentation is archived and is not being maintained.

V isu a l S tu d io 6 .0

Visual Basic: MSChart Control

Standing Property
See Also Example Applies To

Returns or sets a value that specifies w hether axis labels are displayed horizontally in the x or z plane or vertically on the text
baseline in the y plane.

S y n ta x

ob/ect.Standing [ = b o o le a n ]

The S ta n d in g property syntax has these parts:

P a rt D e s c rip tio n

o b ject An o b je ct expression th a t evaluates to an o b je ct in th e Applies To list.

boolean A Boolean expression th a t specifies how to displa y th e axis labels, as described in S ettings.

S e ttin g s

The settings for b o o lea n are:

S e ttin g D e s c rip tio n

T ru e The axis labels are displayed v e rtic a lly on th e te x t baseline in th e y plane.

F a ls e (D e fa u lt) The axis labels are displayed h o rizo n ta lly in th e x o r z plane.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa229075(v=vs.60).aspx 1/1
2. 1.2018 Start Property (Multimedia MCI Control) (Multimedia MCI Control)

This documentation is archived and is not being maintained.

Visual Basic: Multimedia MCI Control


V isu a l S tu d io 6 .0

Start Property (Multimedia MCI Control)


See Also Example Applies To

Specifies, as defined in the M u ltim e d ia M CI control T im e F o rm a t property, the starting position of the current media. This
property is not available at design time and is read-only at run time.

S y n ta x

[fo rm .]M M C o n tro l.S ta rt

D ata T yp e

Long

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa228378(v=vs.60).aspx 1/1
2. 1.2018 StartingAngle Property

This documentation is archived and is not being maintained.

V isu a l S tu d io 6 .0

Visual Basic: MSChart Control

StartingAngle Property
See Also Example Applies To

Returns or sets the position w here you want to start drawing pie charts.

S y n ta x

o b /e cfS ta rtin g A n g le [ = angle]

The S ta rtin g A n g le property syntax has these parts:

P a rt D e s c r ip tio n

o b ject An o b je c t expression th a t evaluates to an o b je ct in th e Applies To list.

angle Single. This angle can be m easured in degrees, radians, o r grads, depending on th e c u rre n t
A ngleU nits se ttin g . A value o f 0 degrees indicates th e 3 o'clock position. S etting th e sta rtin g
angle to 90 degrees m oves th e sta rtin g position to 12 o'clock if th e Clockwise p ro p e rty is set
to coun terclockw ise, o r to 6 o'clock if it's set to clockwise. Valid values range fro m -3 6 0 to 360
degrees.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa229076(v=vs.60).aspx 1/1
2. 1.2018 StartMode Property (Visual Basic Add-In Model)

This documentation is archived and is not being maintained.

Visual Basic Extensibility Reference


V isu a l S tu d io 6 .0

StartMode Property
See Also Example Applies To

Returns or sets the start mode of the project.

S y n ta x

ob/ect.StartM ode

The o b je c t placeholder represents an object expression that evaluates to an object in the Applies To list.

R e m a rks

Returns R u n M o d e if code is currently executing, B re a k M o d e if there is code on the stack but not running, and D e sig n M o d e
otherwise.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263186(v=vs.60).aspx 1/1
2. 1.2018 StartMode Property

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

StartMode Property
See Also Example Applies To

Returns or sets a value that determ ines w hether an application starts as a stand-alone project or as an ActiveX com ponent.
Read-only at run tim e.

S y n ta x

ob/ect.StartM ode

The o b je c t placeholder represents an object expression that evaluates to an object in the Applies To list.

S e ttin g s

The S ta rtM o d e property settings are:

C o n sta n t V a lu e D e scrip tio n

vb S M o d e S ta n d a lo n e 0 (Default) Application starts as a stand-alone project.

V b S M o d e A u to m a tio n 1 Application starts as an ActiveX com ponent.

R e m a rks

These constants are listed in the Visual Basic (VB) object library in the Object Browser.

At design tim e, you can set S ta rtM o d e in the Project Options dialog box to 1 (v b S M o d e A u to m a tio n ) to debug an
application as if it were started as an A ctiveX com ponent.

Once a project is com piled, the value of the S ta rtM o d e property is determ ined by how that application is started, not by its
nominal setting in the Project Options dialog box.

W hen S ta rtM o d e is set to 1 and there are no public classes in the project, you must use the End statem ent or choose End
from the Run menu or toolbar to end the application. If you choose Close from the System menu, the form closes but the
project is still running.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445706(v=vs.60).aspx 1/1
2. 1.2018 StartMode Property Example

Visual Basic Reference


StartMode Property Example
This exam ple shows one possible effect of setting the S ta rtM o d e property to 1 (v b S M o d e A u to m a tio n ) at design time.
Create an ActiveX EXE project. Create a new form. From the Project menu, choose the Project Properties com m and. Select the
Com ponent tab, then select the ActiveX com ponent option button in the Start Mode group. Choose O K to close the Project
Properties dialog box. To try this exam ple, paste the code into the Declarations section of the form, and then press F5 and
double-click the Control menu at the left of the forms title bar. If the form doesnt display, enter Form 1.Show in the
Im m ediate window.

P r iv a t e Sub F o rm _Q u e ry U n lo a d (C a n ce l As I n t e g e r , UnloadMode As In t e g e r )
I f UnloadMode = vbForm ControlM enu And A p p .S ta rtM o d e = vbSM odeAutom ation Then
Msg = "Form w i l l c lo s e but a p p l ic a t i o n w i l l s t i l l be r u n n in g ." & C h r (1 0 )
Msg = Msg + "To t e r m in a t e a p p lic a t io n w ith o u t a p u b lic c l a s s , " & C h r (1 0 )
Msg = Msg + "you must use an End s t a t e m e n t ."
MsgBox Msg
End I f
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445707(v=vs.60).aspx 1/1
2. 1.2018 StartOfWeek Property (Windows Controls)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


V isu a l S tu d io 6 .0

StartOfWeek Property
See Also Example Applies To

Returns or sets a value that specifies the starting day of the week.

S y n ta x

o b je c t .S t a r t O fW e e k [= integer]

The S ta rtO fW e e k property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

in te g e r A num eric expression specifying the starting day of the w eek, as shown in Settings.

S e ttin g s

The settings for in te g e r are:

C o n sta n t V a lu e D e scrip tio n

m vw Sunday 1 (Default) Sunday

m vw M onday 2 M onday

m v w T u e sD a y 3 Tuesday

m v w W e d n e sd a y 4 W ednesday

m v w T h u rsd a y 5 Thursday

m v w F rid a y 6 Friday

m v w S a tu rd a y 7 Saturday

R e m a rks

https://msdn.microsoft.com/en-us/library/aa276884(v=vs.60).aspx 1/2
2. 1.2018 StartOfWeek Property (Windows Controls)

The S ta rtO fW e e k property allows you to specify the day that will appear in the far left side of the calendar. This can be
helpful when designing applications for multiple countries.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa276884(v=vs.60).aspx 2/2
2. 1.2018 StartProject Property (Visual Basic Add-In Model)

This documentation is archived and is not being maintained.

Visual Basic Extensibility Reference


V isu a l S tu d io 6 .0

StartProject Property
See Also Example Applies To

Returns or sets the project that will start w hen the user selects S ta rt from the R un menu, or presses the F5 key.

S y n ta x

ob/ect.StartProject

The o b je c t placeholder represents an object expression that evaluates to an object in the Applies To list.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263187(v=vs.60).aspx 1/1
2. 1.2018 StartUpObject Property (Visual Basic Add-In Model)

This documentation is archived and is not being maintained.

Visual Basic Extensibility Reference


V isu a l S tu d io 6 .0

StartUpObject Property
See Also Example Applies To

Returns or sets the startup com ponent for the project.

S y n ta x

o b /ect.StartU pO bject

The o b je c t placeholder represents an object expression that evaluates to an object in the Applies To list.

R e tu rn V a lu e s

The value that is returned is a variant that contains either an enum erated value of type v b e x t_S ta rtu p O b je c t, or a
V B C o m p o n e n t object that represents the startup object.

The S ta rtU p O b je c t property settings for v b e x t_S ta rtU p O b je c t are:

C o n sta n t V a lu e D e scrip tio n

vb e x t_so _S u b M a in 0 Startup object is the sub Main.

v b e x t_so _N o n e 1 There is no startup object.

R e m a rks

Only visual at run tim e project items can be the startup object.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263188(v=vs.60).aspx 1/1
2. 1.2018 StartUpPosition Property

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

StartUpPosition Property
See Also Example Applies To

Returns or sets a value specifying the position of an object w hen it first appears. Not available at run time.

S y n ta x

ob/ect.StartU pPosition = p o sitio n

The S ta rtU p P o sitio n property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

S ta rtU p P o sitio n An integer that specifies the position of the object, as shown in Settings.

S e ttin g s

You can use one of four settings for S ta rtU p P o sitio n :

C o n sta n t V a lu e D e scrip tio n

v b S ta rtU p M a n u a l 0 No initial setting specified.

v b S ta rtU p O w n e r 1 Center on the item to which the U se rFo rm belongs.

vb S ta rtU p S cre e n 2 Center on the whole screen.

v b S ta rtU p W in d o w sD e fa u lt 3 Position in upper-left corner of screen.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445708(v=vs.60).aspx 1/1
2. 1.2018 State Property (Winsock Control) (Winsock Control)

This documentation is archived and is not being maintained.

Visual Basic: Winsock Control


V isu a l S tu d io 6 .0

State Property (Winsock Control)


See Also Example Applies To

Returns the state of the control, expressed as an enum erated type. Read-only and unavailable at design time.

S y n ta x

object. S tate

The o b je c t placeholder represents an object expression that evaluates to an object in the Applies To list.

D ata T yp e

Integer

S e ttin g s

The settings for the S ta te property are:

C o n sta n t V a lu e D e scrip tio n

sckC lo sed 0 Default. Closed

sckO p en 1 Open

sc k L iste n in g 2 Listening

sc k C o n n e c tio n P e n d in g 3 Connection pending

s c k R e so lv in g H o st 4 Resolving host

sc k H o stR e so lve d 5 Host resolved

sc kC o n n e ctin g 6 Connecting

sckC o n n e cte d 7 Connected

sckC lo sin g 8 Peer is closing the connection

sc k E rro r 9 Error

https://msdn.microsoft.com/en-us/library/aa228160(v=vs.60).aspx 1/2
2. 1.2018 StateManagement Property

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

StateManagement Property
See Also Example Applies To

Sets or returns the state type for a W ebClass.

S y n ta x

o b/ect.StateM anagem ent[= enum ]

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

enum Constant that determ ines how the W ebClass maintains state, as described in Settings.

S e ttin g s

The settings for en u m are:

S e ttin g D e scrip tio n

1 -w cN o S tate The W e b C la ss instance is created when an HTTP request is received. The instance is used for the
duration of the HTTP request and then destroyed. A ny state required by the W e b C la ss object must
be stored externally, for exam ple, in a database m anagem ent system . Alternatively, state or key
inform ation for the state can be saved w ithin the Sessio n object, the URL itself using the U R LD ata
property or cookies using the R e sp o n se .C o o kie s collection.

2- The W e b C la ss object instance is created w hen the first HTTP request is received. The instance is not
w c R e ta in In sta n c e destroyed until either the W e b C la ss object calls R e le a se In sta n c e or the Active Server Pages session
tim es out. State can be safely kept w ithin properties of the W e b C la ss object; however, this will
increase the size and decrease the scalability of yo ur application.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445709(v=vs.60).aspx 1/1
2. 1.2018 Static Property (Visual Basic Add-In Model)

This documentation is archived and is not being maintained.

Visual Basic Extensibility Reference


V isu a l S tu d io 6 .0

Static Property
See Also Example Applies To

Returns w hether the referenced variable or method is declared as Static.

S y n ta x

o b je c t.S ta tic

The o b je c t placeholder represents an object expression that evaluates to an object in the Applies To list.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa263189(v=vs.60).aspx 1/1
2. 1.2018 StatLine Property

This documentation is archived and is not being maintained.

V isu a l S tu d io 6 .0

Visual Basic: MSChart Control

StatLine Property
See Also Example Applies To

Returns a reference to a S ta tL in e object that describes how statistic lines are displayed on a chart.

S y n ta x

o b je ctS tatLin e

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

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa229077(v=vs.60).aspx 1/1
2. 1.2018 Status Property (AsyncProperty Object)

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

Status Property (AsyncProperty Object)


See Also Example Applies To

Returns protocol-specific status inform ation about an A syn c R e a d operation.

S y n ta x

ob/ecf.Status

The S ta tu s property syntax has this part:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

R e m a rks

The S ta tu s property returns a string specific to the S tatu sC o d e property and can be an em pty string. For exam ple, for
v b A sy n cS ta tu sC o d e B e g in C o n n e c tin g , the string is the TCP/IP port address.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445711(v=vs.60).aspx 1/1
2. 1.2018 Status Property (RemoteData Control)

This documentation is archived and is not being maintained.

Visual Basic: RDO Data Control


V isu a l S tu d io 6 .0

Status Property
See Also Example Applies To

Returns or sets the status of the current row or column.

S y n ta x

o b je c t.S ta tu s [= value]

The S ta tu s property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

value A Long integer representing the type of cursor as described in Settings:

S e ttin g s

The S ta tu s property has these settings:

C o n sta n t V a lu e P re p are d P ro p e rty S e ttin g

rd R o w U n m o d ifie d 0 (Default) The row or column has not been modified or has been updated successfully.

rd R o w M o d ifie d 1 The row or column has been modified and not updated in the database.

rd R o w N e w 2 The row or column has been inserted with the A d d N e w method, but not yet inserted into
the database.

rd R o w D e le te d 3 The row or column has been deleted, but not yet deleted in the database.

rd R o w D B D e le te d 4 The row or column has been deleted locally a n d in the database.

R e m a rks

The value of this property indicates if and how this row or column will be involved in the next optim istic batch update.

https://msdn.microsoft.com/en-us/library/aa263042(v=vs.60).aspx 1/2
2. 1.2018 Status Property (RemoteData Control)

W hen you use the optim istic batch update cursor library and need to specify which rows are to be updated in the next batch
operation, you set the rd o R e su ltse t object's S ta tu s property. For exam ple, suppose you are working with an unbound G rid
control filled with rows from a query. The user selects one of the rows and you detect that a change has been made in the
row. At this point you can m ark this row for updating by setting the S ta tu s property to rd R o w M o d ifie d . Sim ilarly, if a row is
added or deleted, you can use the appropriate S ta tu s property setting to so indicate. W hen you use the B a tch U p d a te
method, RDO will subm it an appropriate operation to the remote server for each row based on its S ta tu s property.

Once the B a tch U p d a te operation is com plete, you can exam ine the S ta tu s property of each row to determ ine if the update
is successful. If the S ta tu s value does not return rd R o w U n m o d ifie d after the B a tch U p d a te , the operation to update the row
could not be com pleted. In this case you should check the rd o E rro rs collection and the B a tc h C o llisio n R o w s property for
rows.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263042(v=vs.60).aspx 2/2
2. 1.2018 StatusCode Property

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

StatusCode Property
See Also Example Applies To

Returns a constant specifying the current status of an A syn cR e a d operation.

S y n ta x

o b je c t.S ta tu s C o d e

The S ta tu sC o d e property syntax has this part:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

S e ttin g s

The possible enum erated return values for S tatu sC o d e property are:

C o n sta n t S e ttin g D e scrip tio n

v b A s y n c S ta tu s C o d e E rro r 0 An error occurred during the asynchronous download. To


find out the error, check the V a lu e property of the
A s y n c P ro p object.

v b A sy n cS ta tu sC o d e F in d in g R e so u rc e 1 A syn c R e a d is finding the resource specified in the S ta tu s


property that holds the storage being downloaded.

v b A syn cS ta tu sC o d e C o n n e ctin g 2 A syn c R e a d is connecting to the resource specified in the


S ta tu s property that holds the storage being downloaded.

v b A sy n cS ta tu sC o d e R e d ire c tin g 3 A syn c R e a d has been redirected to a different location


specified in the S ta tu s property.

v b A sy n cS ta tu sC o d e B e g in D o w n lo a d D a ta 4 A syn c R e a d has begun receiving data for the storage


specified in the S ta tu s property.

v b A sy n cS ta tu sC o d e D o w n lo a d in g D a ta 5 A syn c R e a d has received more data for the storage specified


in the S ta tu s property.

vb A sy n cS ta tu sC o d e E n d D o w n lo a d D a ta 6 A syn c R e a d has finished receiving data for the storage


https://msdn.microsoft.com/en-us/library/aa445710(v=vs.60).aspx 1/2
2. 1.2018 StatusCode Property

specified in the S ta tu s property.

v b A syn cS ta tu sC o d e U sin g C a ch e d C o p y 10 A syn c R e a d is retrieving the requested storage from a


cached copy since the S ta tu s property is empty.

v b A sy n cS ta tu sC o d e S e n d in g R e q u e st 11 A syn c R e a d is requesting the storage specified in the S ta tu s


property

v b A s y n c S ta tu s C o d e M IM E T y p e A v a ila b le 13 The MIME type of the requested storage is specified in the


S ta tu s property.

v b A s y n cS ta tu sC o d e C a c h e F ile N a m e A v a ila b le 14 The file name of the local file cache for requested storage is
specified in the S ta tu s property.

v b A sy n cS ta tu sC o d e B e g in S y n c O p e ra tio n 15 The A syn c R e a d will operate synchronously.

vb A sy n cS ta tu sC o d e E n d S y n c O p e ra tio n 16 The A syn c R e a d has com pleted synchronous operation.

R e m a rks

The S ta tu sC o d e constants list contains only the Visual Basic constants. O ther constants not specific to Visual Basic or the
A syn c R e a d method can be found by searching the MSDN Library for BINDSTATUS.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445710(v=vs.60).aspx 2/2
2. 1.2018 SThreshold Property (MSComm Control)

This documentation is archived and is not being maintained.

Visual Basic: MSComm Control


V isu a l S tu d io 6 .0

SThreshold Property
See Also Example Applies To

Sets and returns the minimum num ber of characters allowable in the transm it buffer before the M SC o m m control sets the
C o m m E ve n t property to c o m EvS e n d and generates the O nC o m m event.

S y n ta x

ob/ect.SThreshold [ = va lue ]

The S T h re sh o ld property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

value An integer expression representing the minimum num ber of characters in the transm it buffer before the
OnCom m event is generated.

R e m a rks

Setting the S T h re sh o ld property to 0 (the default) disables generating the O n C o m m event for data transm ission events.
Setting the S T h re sh o ld property to 1 causes the M SC o m m control to generate the O n C o m m event when the transm it
buffer is com pletely empty.

If the num ber of characters in the transm it buffer is less than va lue, the C o m m E ve n t property is set to co m E vS e n d , and the
O n C o m m event is generated. The co m EvS e n d event is only fired once, w hen the num ber of characters crosses the
S T h re sh o ld . For exam ple, if S T h re sh o ld equals five, the co m E vS e n d event occurs only when the num ber of characters drops
from five to four in the output queue. If there are never more than SThreshold characters in the output queue, the event is
never fired.

D ata T yp e

Integer

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259425(v=vs.60).aspx 1/1
2. 1.2018 StillConnecting Property (RemoteData Control)

This documentation is archived and is not being maintained.

Visual Basic: RDO Data Control


V isu a l S tu d io 6 .0

StillConnecting Property
See Also Example Applies To

Returns a value that indicates if the connection has been established.

S y n ta x

ob/ect.StillConnectm g

The o b je c t placeholder represents an object expression that evaluates to an object in the Applies To list.

R e tu rn V a lu e s

The S tillC o n n e ctin g property return values are:

V a lu e D e scrip tio n

T ru e The connection is being made asynchronously but has not been established.

False The connection has been established.

R e m a rks

This property w orks very sim ilarly to the S tillE x e c u tin g property, except that it is T ru e w hile an asynchronous connection to
the server is being perform ed. This property is set to False again after the connection has been established.

All method and property access of the connection object (with the exception of this property and the C ancel method) will
result in trappable errors w hile an asynchronous connection is in progress.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263043(v=vs.60).aspx 1/1
2. 1.2018 StiMConnecting Property Example (RemoteData Control)

Visual Basic: RDO Data Control


StillConnecting Property Example
This exam ple illustrates use of the S tillC o n n e ctin g property w hen establishing a connection using the rd A syn c E n a b le
option.

Dim rdoCn As New rd o C o n n e c tio n


Dim T im e E xp e c te d As S in g le
Dim T s As S in g le , Tn As S in g le

T im e E x p e c te d = 15
W ith rdoCn
.C o n n e c t = "U ID = ;PW D = ;D atabase= W orkD B;" _
& " S e rv e r= F a rA w a y ;D riv e r= {S Q L S e r v e r } " _
& " D S N = '';"
.L o g in T im e o u t = 45
.E s t a b lis h C o n n e c t io n rd D riv e rN o P ro m p t, _
T r u e , rd A sy n c E n a b le
T s = T im e r
P ro g re s s B a r1 .M a x = T im e E xp e c te d ' tim e to Open
W h ile .S t i l l C o n n e c t i n g
Tn = In t ( T i m e r - T s )
I f Tn < T im e E xp e c te d Then
P ro g re s s B a r1 = Tn
E ls e
P ro g re s s B a r1 .M a x = P ro g re s s B a r1 .M a x + 10
T im e E xp e c te d = P ro g re s s B a r1 .M a x
End I f
D o Even ts
Wend
S t a t u s = " D u r a t io n :" & I n t ( T i m e r - T s )

End W ith
rd o C n .C lo s e
E x i t Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263044(v=vs.60).aspx 1/1
2. 1.2018 StillExecuting Property (Remote Data) (RemoteData Control)

This documentation is archived and is not being maintained.

Visual Basic: RDO Data Control


V isu a l S tu d io 6 .0

StillExecuting Property (Remote Data)


See Also Example Applies To

Returns a Boolean value that indicates w hether a query is still executing.

S y n ta x

ob/ect.StillExecutm g

The o b je c t placeholder represents an object expression that evaluates to an object in the Applies To list.

R e tu rn V a lu e s

The S tillE x e c u tin g property return values are:

V a lu e D e scrip tio n

T ru e The query is still executing.

False The query is ready to return the result set.

R e m a rks

Use the S tillE x e c u tin g property to determ ine if a query is ready to return the first result set. Until the S tillE x e c u tin g
property is False, the associated object cannot be accessed. However, unless you use the rd A syn c E n a b le option, your
application will block until the query is com pleted and ready to process the result set.

Once the S tillE x e c u tin g property returns False, the first or next result set is ready for processing. W hen you use the
M o re R e su lts method to com plete processing of a result set, the S tillE x e c u tin g property is reset to T ru e while the next
result sets is retrieved.

The S tillE x e c u tin g property also changes to T ru e w hen you execute a Move method. For exam ple executing M o v e L a st
against an rd o R e su ltse t resets the S tillE x e c u tin g property to T ru e as long as RDO continues to fetch rows from the remote
server.

You can also use the Q u e ry C o m p le te event to indicate when a query has com pleted and the associated rd o R e s u ltse t object
is ready to process.

Use the C ancel method to term inate processing of an executing query, including all statem ents in a batch query.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263045(v=vs.60).aspx 1/1
2. 1.2018 StillExecuting Property Example (RemoteData Control)

Visual Basic: RDO Data Control


StillExecuting Property Example
This exam ple illustrates use of the S tillE x e c u tin g property to m onitor the progress of a query that is expected to take more
than a few seconds. By enabling RDO's asynchronous mode, control returns to the application long before the query is
com plete. W hile waiting for the S tillE x e c u tin g property to return False, we display a progress bar that has been
program med to reflect the length of tim e that the query is expected to take. Note that if this tim e is exceeded, the progress
bar is re-calibrated to reflect the longer duration.

Dim rdoCn As New rd o C o n n e c tio n


Dim rd o R s As r d o R e s u lt s e t
Dim SQL As S t r in g
Dim T im e E xp e c te d As S in g le
Dim T s As S in g le , Tn As S in g le

W ith rdoCn
.C o n n e c t = "U ID = ;PW D = ;D atabase= W orkD B;" _
& " S e rv e r= S E Q U E L ;D riv e r= {S Q L S e r v e r } " _
& " D S N = '';"
.L o g in T im e o u t = 5
.E s t a b lis h C o n n e c t io n rd D riv e rN o P ro m p t, T ru e

SQL = " E x e c u t e V e ry L o n g P ro c e d u re "


T im e E xp e c te d = 20 ' We e x p e c t t h i s t o t a k e 60 s e c .

S e t rdoR s = .O p e n R e su ltse t(N a m e := S Q L , _


T y p e := rd O p e n F o rw a rd O n ly , _
L o c k T y p e := rd C o n c u rR e a d O n ly , _
O p tio n := rd A s y n c E n a b le )
T s = T im e r
P ro g re s s B a r1 .M a x = T im e E xp e c te d
W h ile r d o R s .S t i l l E x e c u t i n g
Tn = In t ( T i m e r - T s )
I f Tn < T im e E xp e c te d Then
P ro g re s s B a r1 = Tn
E ls e
P ro g re s s B a r1 .M a x = P ro g re s s B a r1 .M a x + 10
T im e E xp e c te d = P ro g re s s B a r1 .M a x
End I f
D o Even ts
Wend
S t a t u s = "Q u e ry d o ne. D u r a t io n :" & In t ( T i m e r - T s )

End W ith
r d o R s .C lo s e
rd o C n .C lo s e

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa263046(v=vs.60).aspx 1/1
2. 1.2018 StillExecuting Property

This documentation is archived and is not being maintained.

Visual Basic: Internet Control


V isu a l S tu d io 6 .0

StillExecuting Property
See Also Example Applies To

Returns a value that specifies if the In te rn e t T ra n s fe r control is busy. The control will return T ru e w hen it is engaged in an
operation such as retrieving a file from the Internet. The control will not respond to other requests when it is busy.

S y n ta x

ob/ecfStiN Executing = boo lea n

The S tillE x e c u tin g property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

b o o lea n A Boolean expression specifying w hether the control is busy or not.

D ata T yp e

Boolean

S e ttin g s

The settings for b o o lea n are:

C o n sta n t V a lu e D e scrip tio n

T ru e 1 The control is busy.

False 0 The control is not busy.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa239751(v=vs.60).aspx 1/1
2. 1.2018 Stretch Property

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

Stretch Property
See Also Example Applies To

Returns or sets a value indicating w hether a graphic resizes to fit the size of an Im a g e control.

S y n ta x

o b je c t.S tr e tc h [= boolean ]

The S tre tch property syntax has these parts:

P a rt D e scrip tio n

O b ject An object expression that evaluates to an object in the Applies To list.

B oolea n A Boolean expression specifying w hether the graphic resizes, as described in Settings.

S e ttin g s

The settings for b o o lea n are:

S e ttin g D e scrip tio n

T ru e The graphic resizes to fit the control.

False (Default) The control resizes to fit the graphic.

R e m a rks

If S tre tch is set to T ru e , resizing the control also resizes the graphic it contains.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445712(v=vs.60).aspx 1/1
2. 1.2018 Stretch Property Example

Visual Basic Reference


Stretch Property Example
This exam ple loads an arrow icon from an icons directory into an Im a g e control. The arrow crawls across the form w hen the
S tre tch property is set to T ru e and hops across the form w hen S tre tch is set to False. To try this exam ple, paste the code
into the Declarations section of a form that contains an Im a g e control, a C h e c k B o x control, and a T im e r control, and then
press F5 and click the form. Be sure to check the path to yo ur icons directory and change it if necessary. To see the effects of
the S tre tch property, click the C h e c k B o x, and then click the form again.

Dim ImgW ' D e c la r e v a r i a b l e .


P r iv a t e Sub Form _Load ( )
' Load an ic o n in t o th e Image c o n t r o l.
Im a g e 1 .P ic t u r e = Lo ad Picture("IC O N S\A R R O W S \A R W 0 2 R T.IC O ")
Im a g e 1 .L e ft = 0 ' Move image to l e f t e d g e .
ImgW = Im ag e 1 .W id th ' Save w id th o f im ag e .
T i m e r 1 .I n t e r v a l = 300
T im e r1 .E n a b le d = F a ls e ' T u rn o f f t im e r .
C h e c k 1 .C a p tio n = " S t r e t c h P r o p e r t y "
End Sub

P r iv a t e Sub F o r m _ C lic k ( )
T im e r1 .E n a b le d = T ru e ' T u rn on th e t im e r .
End Sub

P r iv a t e Sub T im e r1 _ T im e r ( )
S t a t i c M oveIcon As In t e g e r ' F la g f o r moving th e ic o n .
I f Not M oveIcon Then
Im age1.M ove Im a g e 1 .L e ft + ImgW, Im a g e 1 .T o p , ImgW * 2
E ls e
' Move th e image and r e t u r n i t to o r i g i n a l w id t h .
Im age1.M ove Im a g e 1 .L e ft + ImgW, Im a g e 1 .T o p , ImgW
End I f
' I f image i s o f f edge o f fo rm , s t a r t o v e r .
I f Im a g e 1 .L e ft > S c a le W id th Then
Im a g e 1 .L e ft = 0
T im e r1 .E n a b le d = F a ls e
End I f
M oveIcon = Not M oveIcon ' R e se t f l a g .
End Sub

P r iv a t e Sub C h e c k 1 _ C lic k ( )
Im a g e 1 .S t r e t c h = C h e c k 1 .V a lu e
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445713(v=vs.60).aspx 1/1
2. 1.2018 StretchX, StretchY Properties (PictureClip Control) (PictureClip Control)

This documentation is archived and is not being maintained.

Visual Basic: PictureClip Control


V isu a l S tu d io 6 .0

StretchX, StretchY Properties (PictureClip


Control)
See Also Example Applies To

Specify the target size for the bitmap created with the C lip property. These properties are not available at design time.

S y n ta x

[fo rm .]P ic tu re C lip .S tre tc h X [ = X% ]

[fo rm .]P ic tu re C lip .S tre tc h Y [ = V%]

R e m a rks

Use these properties to define the area to which the Clip bitmap is copied. W hen the bitmap is copied, it is either stretched
or condensed to fit the area defined by S tre tc h X and S tre tch Y .

S tre tc h X and S tre tc h Y are measured in pixels.

N o te In Visual Basic, the default S cale M o d e for forms and picture boxes is twips. Set S cale M o d e = 3 (pixels) for all controls
that display pictures from a P ic tu re C lip control.

D ata T yp e

Integer

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa228460(v=vs.60).aspx 1/1
2. 1.2018 Clip Example (PictureClip Control) (PictureClip Control)

Visual Basic: PictureClip Control


Clip Example (PictureClip Control)
V isu a l B asic E xa m p le

The following exam ple displays a C lip ¡mage In a picture box when the user specifies X and Y coordinates and then clicks a
form. F irst create a form with a P ic tu re B o x , a P ic tu re C lip control, and two TextBox controls. At design tim e, use the
Properties sheet to load a valid bitmap into the P ic tu re C lip control.

P r iv a t e Sub F o r m _ C lic k ( )
Dim SaveMode As In t e g e r
' Save th e c u r r e n t ScaleM ode f o r th e p ic t u r e b o x.
SaveMode = P ic t u re 1 .S c a le M o d e
' G et X and Y c o o r d in a t e s o f th e c lip p in g r e g io n .
P i c C l i p 1 . C l i p X = V a l ( T e x t 1 .T e x t )
P i c C l i p 1 . C l i p Y = V a l ( T e x t 2 .T e x t )
' S e t th e a re a o f th e c lip p in g re g io n (in p ix e ls ).
P ic C li p 1 .C li p H e ig h t = 100
P ic C lip 1 .C lip W id t h = 100
' S e t th e p ic t u r e box ScaleM ode to p i x e l s .
P ic t u re 1 .S c a le M o d e = 3
' S e t th e d e s t in a t io n a r e a t o f i l l th e p ic t u r e b o x.
P i c C l i p 1 .S t r e t c h X = P ic t u r e 1 .S c a le W id t h
P i c C l i p 1 .S t r e t c h Y = P ic t u r e 1 .S c a le H e ig h t
' A s s ig n th e c lip p e d b itm ap to th e p ic t u r e b o x.
P ic t u r e 1 .P ic t u r e = P ic C lip 1 .C lip
' R e se t th e ScaleM ode o f th e p ic t u r e b o x.
P ic t u re 1 .S c a le M o d e = SaveMode
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa228418(v=vs.60).aspx 1/1
2. 1.2018 StrikeThrough Property

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

StrikeThrough Property
See Also Example Applies To

Returns or sets the font style of the Fo nt object to either strikethrough or nonstrikethrough.

S y n ta x

o b /ecf.StrikeThro ugh [= boolean ]

The S trik e T h ro u g h property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

b o o lea n A Boolean expression specifying the font style, as described in Settings.

S e ttin g s

The settings for b o o lea n are:

S e ttin g D e scrip tio n

T ru e Turns on strikethrough formatting.

False (Default) Turns off strikethrough formatting.

R e m a rks

The Fo n t object isn't directly available at design tim e. Instead you set the S trik e T h ro u g h property by choosing a control's
Fo n t property in the Properties w indow and clicking the Properties button. In the Font dialog box, select the Strikeout check
box. At run tim e, however, you set S trik e T h ro u g h directly by specifying its setting for the Fo n t object.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa445714(v=vs.60).aspx 1/1
2. 1.2018 Bold, Italic, Size, StrikeThrough, Underline, Weight Properties Example

Visual Basic Reference


Bold, Italic, Size, StrikeThrough, Underline,
Weight Properties Example
This exam ple prints text on a form with each mouse click. To try this exam ple, paste the code into the Declarations section of
a form, and then press F5 and click the form twice.

P r iv a t e Sub F o r m _ C lic k ( )
F o n t .B o ld = Not F o n t .B o ld ' T o g g le b o ld .
F o n t .S t r ik e T h r o u g h = Not F o n t .S t r ik e T h r o u g h ' T o g g le s t r ik e t h r o u g h .
F o n t . I t a l i c = Not F o n t . I t a l i c ' T o g g le i t a l i c .
F o n t .U n d e r lin e = Not F o n t .U n d e r lin e ' T o g g le u n d e r lin e .
F o n t .S iz e = 16 ' S e t S iz e p r o p e r t y .
I f F o n t .B o ld Then
P r in t "F o n t w e ig h t i s " & F o n t.W e ig h t & " ( b o l d ) . "
E ls e
P r in t "F o n t w e ig h t i s " & F o n t.W e ig h t & " (n o t b o l d ) ."
End I f
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa245044(v=vs.60).aspx 1/1
2. 1.2018 Style Property (Band Object) (CoolBar Control)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


V isu a l S tu d io 6 .0

Style Property (Band Object)


See Also Example Applies To

Sets or returns a value indicating the sizing behavior of a Band object in a C o o lB a r control.

S y n ta x

o b je c t.S ty le [= enum ]

The S ty le property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to a Band object.

enum A constant or value specifying the style, as described in Settings.

S e ttin g s

The settings for en u m are:

C o n sta n t V a lu e D e scrip tio n

c c3 B a n d N o rm a l 0 (Default) Band can be resized. Sizing gripper is displayed only if there are two or more
bands in the CoolBar control

c c 3 B a n d F ixe d S iz e 1 Band can not be resized. Sizing gripper is not displayed.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa276538(v=vs.60).aspx 1/1
2. 1.2018 Style Property (Button Object)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


V isu a l S tu d io 6 .0

Style Property (Button Object)


See Also Example Applies To

Returns or sets a constant or value that determ ines the appearance and behavior of a B u tto n object in a T o o lb a r control.

S y n ta x

object. S ty le [=value]

The S ty le property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to a B u tto n object.

value A constant or integer that determ ines the appearance and behavior of a B u tto n object, as specified in Settings.

S e ttin g s

The settings for va lue are:

C o n sta n t V a lu e D e scrip tio n

tb rD e fa u lt 0 (Default) Button. The button is a regular push button.

tb rC h e c k 1 Check. The button is a check button, which can be checked or unchecked.

tb rB u tto n G ro u p 2 ButtonGroup. The button remains pressed until another button in the group is pressed.
Exactly one button in the group can be pressed at any one moment.

tb rS e p a ra to r 3 Separator. The button functions as a separator with a fixed width of 8 pixels.

tb rP la c e h o ld e r 4 Placeholder. The button is like a separator in appearance and functionality, but has a
settable width.

tb rD ro p D o w n 5 M enuButton drop down. Use this style to see M enuButton objects.

R e m a rks

https://msdn.microsoft.com/en-us/Nbrary/aa259705(v=vs.60).aspx 1/2
2. 1.2018 Style Property (Button Object)

Buttons that have the ButtonGroup style must be grouped. To distinguish a group, place all B u tto n objects with the same
style (ButtonGroup) between two B u tto n objects with the Separator style.

You can also place another control on a toolbar by assigning a B u tto n object the PlaceHolder style, then drawing a control
on to the toolbar. For exam ple, to place a drop-down com bo box on a toolbar at design tim e, add a B u tto n object with the
PlaceHolder style and size it to the size of a C o m b o B o x control. Then place a C o m b o B o x on the placeholder.

W hen a B u tto n object is assigned the PlaceHolder style, you can set the value of the W id th property to accom m odate
another control placed on the B u tto n . If a B u tto n object has the Button, Check, or ButtonGroup style, the height and width
are determined by the B u tto n H e ig h t and B u tto n W id th properties.

If you place a control on a button with the PlaceHolder style, you must use code to align and size the control if the form is
resized, as shown below:

P r iv a t e Sub F o r m _ R e s iz e ()
' T r a c k a ComboBox by s e t t i n g i t s T o p , L e f t , and
' W idth p r o p e r t ie s
' to th e T o p , L e f t , and W idth p r o p e r t ie s o f a
' B u tto n o b je c t
W ith T o o lb a r1 .B u tto n s (" C o m b o 1 " )
Combo1.Move . L e f t ,. T o p , . W i d t h
End W ith
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259705(v=vs.60).aspx 2/2
2. 1.2018 Style Property (DataCombo Control) (DataCombo Control)

This documentation is archived and is not being maintained.

Visual Basic: DataCombo/DataList Controls


V isu a l S tu d io 6 .0

Style Property (DataCombo Control)


See Also Example Applies To

Returns or sets a value that specifies the behavior and/or appearance of the control.

S y n ta x

o b je c t.S ty le [= integer]

The S ty le property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

in te g e r Optional. A num eric expression that determ ines the style of the control, as shown in Settings.

S e ttin g s

The settings for in te g e r are:

C o n sta n t V a lu e D e scrip tio n

d b c D ro p d o w n C o m b o 0 (Default) Dropdown Combo. Includes a drop-down list and a text box. The user can
select from the list or type in the text box.

d b cS im p le C o m b o 1 Sim ple Combo. Includes a text box and a list, which doesn't drop down. The user can
select from the list or type in the text box. Increase the Height property to display
more of the list.

d b c D ro p d o w n L ist 2 Dropdown List. This style allows selection only from the drop-down list.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa260168(v=vs.60).aspx 1/1
2. 1.2018 Style Property (MSChart Control)

This documentation is archived and is not being maintained.

V isu a l S tu d io 6 .0

Visual Basic: MSChart Control

Style Property (MSChart Control)


See Also Example Applies To

Returns or sets the style used to draw certain chart elem ents

S y n ta x

o b je c t.S ty le [=sty/e]

The S ty le property syntax has these parts:

P a rt D e s c r ip tio n

o b ject An o b je c t expression th a t evaluates to an o b je ct in th e Applies To list.

style For th e B ru s h o b je ct, a V tB rushS tyle co n sta n t describing th e brush pa tte rn .


For th e F ill o b je ct, a V tF illS tyle co n sta n t th a t describes th e style o f fill. A fill can have a brush,
w hich is a solid color o r p attern ed fill.

For th e F ra m e o b je ct, a V tF ram eS tyle co n sta n t th a t describes th e typ e o f fram e.

For th e M a rk e r o b je ct, a V tM a rke rS tyle co n sta n t th a t lists th e m a rke r type.

For th e P e n o b je ct, a V tPenStyle co n sta n t th a t describes th e style o f pen.

For th e S h a d o w o b je ct, a V tS hadow S tyle co n sta n t used to describe th e shadow type.

For th e T ic k o b je ct, a V tC hA xisTickS tyle co n sta n t used to describe th e axis tic k position.

For th e V tF o n t o b je ct, a V tF on tS tyle co n sta n t describing th e style o f fo n t.

For th e W e ig h tin g o b je ct, a V tC hP ieW eightS tyle co n sta n t th a t id e n tifie s th e w e ig h tin g fa c to r


m ethod.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa229078(v=vs.60).aspx 1/1
2. 1.2018 Style Property (Panel Object)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


V isu a l S tu d io 6 .0

Style Property (Panel Object)


See Also Example Applies To

Returns or sets the style of a S ta tu sB a r control's Panel object.

S y n ta x

object. S ty le [= num ber]

The S ty le property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to a P an e l object.

num ber An integer or constant specifying the style of the Pan e l, as described in Settings.

S e ttin g s

The settings for n u m b e r are:

C o n sta n t V a lu e D e scrip tio n

s b rT e x t 0 (Default). Text and/or a bitmap. Set text with the T e x t property.

sb rC a p s 1 Caps Lock key. Displays the letters CAPS in bold w hen Caps Lock is enabled, and dimmed when
disabled.

sb rN u m 2 Num ber Lock. Displays the letters NUM in bold when the num ber lock key is enabled, and dimmed
when disabled.

sb rIn s 3 Insert key. Displays the letters INS in bold w hen the insert key is enabled, and dimmed when
disabled.

sb rS c rl 4 Scroll Lock key. Displays the letters SCRL in bold w hen scroll lock is enabled, and dimmed when
disabled.

sb rT im e 5 Time. Displays the current tim e in the system format.

sb rD a te 6 Date. Displays the current date in the system format.

https://msdn.microsoft.com/en-us/library/aa259706(v=vs.60).aspx 1/2
2. 1.2018 Style Property (Panel Object)

sb rK a n a 7 Kana. displays the letters KANA in bold when scroll lock is enabled, and dimmed w hen disabled.

R e m a rks

If you set the S ty le property to any style except 0 (text and bitmap), any text set with the T e x t property will not display
unless the S ty le property is set to 0.

The S ty le property can be set as Panel objects are added to a collection. See the A d d method for more inform ation.

N o te The S ta tu sB a r control also has a S ty le property. W hen the S ta tu s B a r control's S ty le is set to Sim ple, the control
displays only one large panel and its string (set with the S im p le T e x t property).

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259706(v=vs.60).aspx 2/2
2. 1.2018 Style Property (Panel Object) Example

Visual Basic: Windows Controls


Style Property (Panel Object) Example
This exam ple displays data in the various styles on a S ta tu s B a r control. To try this exam ple, place a S ta tu s B a r control on a
form and paste the code into the form's Declarations section, and run the exam ple.

P r iv a t e Sub F o rm _Lo a d ()
' Dim v a r i a b l e s .
Dim I as In t e g e r
Dim p n lX as P a n e l

For I = 1 to 5 ' Add 5 p a n e ls .


S e t p n lX = S t a t u s B a r 1 .P a n e ls .A d d ( )
N ext I

' S e t th e s t y l e o f each p a n e l.
W ith S t a t u s B a r 1 .P a n e ls
. I t e m ( 1 ) . S t y l e = s b rD a te ' Date
. I t e m ( 2 ) . S t y l e = sb rT im e ' Tim e
. I t e m ( 3 ) . S t y l e = sb rC a p s ' Caps lo c k
. I t e m ( 4 ) . S t y l e = sbrNum ' Number lo c k
. I t e m ( 5 ) . S t y l e = s b r In s ' I n s e r t key
.It e m ( 6 ) .S t y le = s b r S c r l ' S c r o l l lo c k
End W ith
Fo rm 1 .W id th = 9140 ' Widen fo rm to show a l l p a n e ls .
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa259707(v=vs.60).aspx 1/1
2. 1.2018 Style Property (SSTab Control) (SSTab Control)

This documentation is archived and is not being maintained.

Visual Basic: MSTab Control


V isu a l S tu d io 6 .0

Style Property (SSTab Control)


See Also Example Applies To

Returns or sets the style of the tabs on an S S Tab control.

S y n ta x

o b je c t.S ty le [ = va lue ]

The S ty le property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an S S T ab control.

value A constant or integer that specifies the style of the tabs, as described in Settings.

S e ttin g s

The settings for va lue are:

C o n sta n t V a lu e D e scrip tio n

ssS ty le T a b b e d D ia lo g 0 (Default) The tabs that appear in the tabbed dialogs look like those in M icrosoft Office
for M icrosoft W indows 3.1 applications. If you select this style, the active tab's font is
bold.

ssS ty le P ro p e rty P a g e 1 The tabs that appear in the tabbed dialogs look like those in M icrosoft W indows 95 (or
later). W hen you select this setting, the T a b M a x W id th property is ignored and the
width of each tab adjusts to the length of the text in its caption. The font used to
display text in the tab is not bold.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/Nbrary/aa228559(v=vs.60).aspx 1/1
2. 1.2018 Style Property (StatLine)

This documentation is archived and is not being maintained.

V isu a l S tu d io 6 .0

Visual Basic: MSChart Control

Style Property (StatLine)


See Also Example Applies To

Returns or sets the line type used to display the statistic line.

S y n ta x

o b je c t.S ty le (type )[ = style]

The S ty le property syntax has these parts:

P a rt D e s c r ip tio n

o b ject An o b je c t expression th a t evaluates to an o b je ct in th e Applies To list.

type In te g e r. A V tC hS tats co n sta n t used to describe th e line type.

style In te g e r. A V tPenStyle co n sta n t used to describe th e s ta t line style.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa229079(v=vs.60).aspx 1/1
2. 1.2018 Style Property (StatusBar Control)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


V isu a l S tu d io 6 .0

Style Property (StatusBar Control)


See Also Example Applies To

Returns or sets the style of a S ta tu sB a r control.

S y n ta x

object. S ty le [= num ber]

The S ty le property syntax has these parts:

P a rt D e scrip tio n

object An object expression that evaluates to a S ta tu s B a r control.

num ber An integer or constant that determ ines the appearance of the S ta tu s B a r control, as specified in Settings.

S e ttin g s

The settings for n u m b e r are:

C o n sta n t V a lu e D e scrip tio n

sb rN o rm a l 0 (Default). Normal. The S ta tu s B a r control shows all P an e l objects.

sb rS im p le 1 Simple. The control displays only one large panel.

R e m a rks

The S ta tu s B a r can toggle between two modes: Normal and Simple. W hen in Sim ple style, the S ta tu s B a r displays only one
panel. The appearance also changes: the bevel style is raised with no borders. This allows the control to have two
appearances, both of which are maintained separately from each other.

You can display different strings depending on the control's style. Use the S im p le T e x t property to set the text of the string
to be displayed w hen the S ty le property is set to Simple.

N o te W hen the S ty le property is set to Sim ple, the S ta tu s B a r control displays a large panel (the width of the control) which
cannot be controlled through the Panels collection.

https://msdn.microsoft.com/en-us/library/aa259709(v=vs.60).aspx 1/2
2. 1.2018 Style Property (StatusBar Control) Example

Visual Basic: Windows Controls


Style Property (StatusBar Control) Example
This exam ple adds two Panel objects to a S ta tu s B a r control that appear in Normal style, and then adds a string (using the
S im p le T e x t property) that will appear w hen the S ty le property is set to Sim ple. The control toggles between the Sim ple style
and the Normal style to show the S im p le T e x t property string. To try the exam ple, place a S ta tu s B a r control on a form and
paste the code into the Declarations section of the form. Run the exam ple and click on the S ta tu s B a r control.

P r iv a t e Sub F o rm _Lo a d ()
Dim I As In t e g e r
For I = 1 to 2
S t a t u s B a r 1 .P a n e ls .A d d
N ext I
W ith S t a t u s B a r 1 .P a n e ls
. I t e m ( 1 ) . S t y l e = s b rD a te ' Date
. I t e m ( 2 ) . S t y l e = sb rC a p s ' Caps lo c k
.It e m ( 3 ) .S t y le = sb rS c rl ' S c r o l l lo c k
End W ith

End Sub

P r iv a t e Sub S t a t u s B a r 1 _ C lic k ( )
W ith S t a t u s B a r 1
If. S t y l e = sb rN o rm al Then
.S im p le T e x t = Tim e ' Show th e t im e .
. S t y l e = s b rS im p le ' S im p le s t y l e
E ls e
. S t y l e = sb rN o rm al ' Normal s t y l e
End I f
End W ith
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259710(v=vs.60).aspx 1/1
2. 1.2018 Style Property (TabStrip Control)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


V isu a l S tu d io 6 .0

Style Property (TabStrip Control)


See Also Example Applies To

Returns or sets the appearance tabs or buttons of a T a b S trip control.

S y n ta x

object. S ty le [= value]

The S ty le property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to a T a b S trip control.

value A constant or integer that determ ines the appearance of the tabbed dialog box, as described in Settings.

S e ttin g s

The settings for va lue are:

C o n sta n t V a lu e D e scrip tio n

ta b T a b s 0 (Default) Tabs. The tabs appear as notebook tabs, and the internal area has a th re e ­
dim ensional border around it.

ta b B u tto n s 1 Buttons. The tabs appear as regular push buttons, and the internal area has no border around
it.

ta b F la tB u tto n s 2 Flat buttons. The selected tab appears as pressed into the background. Unselected tabs
appear flat.

R e m a rks

At design tim e, select the S ty le property you want tabs or buttons from the Style list on the General tab of the Properties
Page of the T a b S trip control.

At run tim e, use code like the following to set the S ty le property:

https://msdn.microsoft.com/en-us/library/aa259718(v=vs.60).aspx 1/2
2. 1.2018 Style Property (TabStrip Control)

' S t y le p r o p e r ty s e t to th e Tab s s t y l e .
T a b S t r ip l.S t y le = ta b T a b s

' S t y le p r o p e r ty s e t to th e B u tto n s s t y l e :
T a b S t r i p l . S t y l e = t a b B u tto n s

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259718(v=vs.60).aspx 2/2
2. 1.2018 Style Property (Toolbar Control)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


V isu a l S tu d io 6 .0

Style Property (Toolbar Control)


See Also Example Applies To

Returns or sets a value that determ ines the appearance of the control.

S y n ta x

o b je c t.S ty le [= integer]

The S ty le property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

in te g e r A num eric expression that determ ines the appearance of the control, as shown in Settings.

S e ttin g s

The settings for in te g e r are:

C o n sta n t V a lu e D e scrip tio n

tb rS ta n d a rd 0 (Default) Standard toolbar.

tb rT ra n sp a re n t 1 The buttons and the toolbar are transparent, button text appears under button bitmaps, and
hot tracking is turned on.

tb rR ig h t 2 Sim ilar to tbrTransparent style, except that the button text appears to the right of the image,
if any.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259708(v=vs.60).aspx 1/1
2. 1.2018 Style Property (Tree View Control)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


V isu a l S tu d io 6 .0

Style Property (TreeView Control)


See Also Example Applies To

Returns or sets the type of graphics (im ages, text, plus/m inus, and lines) and text that appear for each N o de object in a
T re e V ie w control.

S y n ta x

o b j e c t .Style [ = number]

The S ty le property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

num ber An integer specifying the style of the graphics, as described in Settings.

S e ttin g s

The settings for n u m b e r are:

S e ttin g D e scrip tio n

0 Text only.

1 Im age and text.

2 Plus/minus and text.

3 Plus/m inus, image, and text.

4 Lines and text.

5 Lines, im age, and text.

6 Lines, plus/m inus, and text.

7 (Default) Lines, plus/m inus, im age, and text.

https://msdn.microsoft.com/en-us/library/aa259711(v=vs.60).aspx 1/2
2. 1.2018 Style Property (Tree View Control)

R e m a rks

If the S ty le property is set to a value that includes lines, the L in e S ty le property determ ines the appearance of the lines. If the
S ty le property is set to a value that does not include lines, the L in e S ty le property will be ignored.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259711(v=vs.60).aspx 2/2
2. 1.2018 Style Property

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

Style Property
See Also Example Applies To

Returns or sets a value indicating the display type and behavior of the control. Read only at run tim e.

S y n ta x

o b je c t.S ty le

The o b je c t placeholder represents an object expression that evaluates to an object in the Applies To list.

S e ttin g s

The S ty le property settings for the C h e c k b o x, C o m m a n d B u tto n , and O p tio n B u tto n controls are:

C o n sta n t V a lu e D e scrip tio n

v b B u tto n S ta n d a rd 0 (Default) Standard. The control displays as it did in previous versions of Visual Basic. That
is, a C h e c k b o x control displays as a checkbox with a label next to it, an O p tio n B u tto n as
an option button with a label next to it, and a C o m m a n d B u tto n as standard
C o m m a n d B u tto n without an associated graphic.

vb B u tto n G ra p h ic a l 1 Graphical. The control displays in a graphical style. That is, a C h e c k b o x control displays as
a C o m m an d B u tto n -like button which can be toggled either up or down, an
O p tio n B u tto n displays as a C o m m a n d B u tto n -like button which remains toggled up or
down until another O p tio n B u tto n in its option group is selected, and a
C o m m a n d B u tto n displays as a standard C o m m a n d B u tto n that can also display an
associated graphic.

The S ty le property settings for the C o m b o B o x control are:

C o n sta n t V a lu e D e scrip tio n

vb C o m b o D ro p D o w n 0 (Default) Dropdown Combo. Includes a drop-down list and a text box. The user can
select from the list or type in the text box.

vb C o m b o S im p le 1 Sim ple Combo. Includes a text box and a list, which doesn't drop down. The user can
select from the list or type in the text box. The size of a Sim ple com bo box includes
both the edit and list portions. By default, a Sim ple com bo box is sized so that none of
the list is displayed. Increase the H e ig h t property to display more of the list.

https://msdn.microsoft.com/en-us/library/aa445715(v=vs.60).aspx 1/2
2. 1.2018 Style Property

vb C o m b o D ro p - 2 Dropdown List. This style allows selection only from the drop-down list.
D o w n List

The S ty le property settings for the L is tB o x control are:

C o n sta n t V a lu e D e scrip tio n

v b L is tB o x S ta n d a rd 0 (Default) Standard. The L is tB o x control displays as it did in previous versions of Visual


Basic; That is, as a list of text items.

v b L is tB o x C h e c k b o x 1 CheckBox. The L is tB o x control displays with a checkbox next to each text item. Multiple
items in the L is tB o x can be selected by selecting the checkbox beside them.

R e m a rks

For the C o m b o B o x control, follow these guidelines in deciding which setting to choose:

• Use setting 0 (Dropdown Combo) or setting 1 (Simple Combo) to give the user a list of choices. Either style enables
the user to enter a choice in the text box. Setting 0 saves space on the form because the list portion closes when the
user selects an item.

• Use setting 2 (Dropdown List) to display a fixed list of choices from which the user can select one. The list portion
closes w hen the user selects an item.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445715(v=vs.60).aspx 2/2
2. 1.2018 SubFolders Property

This documentation is archived and is not being maintained.

Visual Basic for Applications Reference


V isu a l S tu d io 6 .0

SubFolders Property
See Also Example Applies To Specifics

D e scrip tio n

Returns a Fo ld e rs collection consisting of all folders contained in a specified folder, including those with Hidden and System
file attributes set.

S y n ta x

ob/ect.SubFolders

The o b je c t is always a F o ld e r object.

R e m a rks

The following code illustrates the use of the S u b F o ld e rs property:

Sub S h o w F o ld e r L is t ( f o ld e r s p e c )
Dim f s , f , f 1 , s , s f
S e t f s = C r e a t e O b j e c t ( " S c r i p t in g .F ile S y s t e m O b je c t " )
S e t f = f s .G e t F o ld e r ( f o l d e r s p e c )
S e t s f = f .S u b F o ld e r s
F o r Each f 1 in s f
s = s & f1 .n a m e
s = s & v b C rL f
N ext
MsgBox s
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa265886(v=vs.60).aspx 1/1
2. 1.2018 SubItemIndex Property

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


V isu a l S tu d io 6 .0

SubItemIndex Property
See Also Example Applies To

Returns the index of the subitem associated with a C o lu m n H e a d e r object in a L is tV ie w control.

S y n ta x

o b j e c t .SubItemIndex [= integer]]

The S u b Ite m In d e x property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to a C o lu m n H e a d e r object.

in te g e r An integer specifying the index of the subitem associated with the C o lu m n H e a d e r object.

R e m a rks

Subitem s are arrays of strings representing the L istIte m object's data when displayed in Report view.

The first column header always has a S u b Ite m In d e x property set to 0 because the small icon and the L istIte m object's text
always appear in the first column and are considered L istIte m objects rather than subitems.

The num ber of column headers dictates the num ber of subitem s. There is always exactly one more column header than there
are subitems.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259712(v=vs.60).aspx 1/1
2. 1.2018 SubItemIndex Property Example

Visual Basic: Windows Controls


SubItemIndex Property Example
This exam ple adds three C o lu m n H e a d e r objects to a L is tV ie w control. The code then adds several L istIte m and S u b ite m s
using the S u b Ite m In d e x to associate the S u b ite m s string with the correct C o lu m n H e a d e r object. To try the exam ple, place
a L is tV ie w control on a form and paste the code into the form's Declarations section. Run the example.

' Make s u re L is t V ie w c o n t r o l i s in r e p o r t v ie w .
L is t V ie w 1 .V ie w = lv w R e p o rt

' Add t h r e e co lu m n s.
L is tV ie w 1 .C o lu m n H e a d e rs .A d d , "Nam e", "Name"
L is tV ie w 1 .C o lu m n H e a d e rs .A d d , " A d d r e s s " , " A d d re s s "
L is tV ie w 1 .C o lu m n H e a d e rs .A d d , " P h o n e ", "Phone"

' Add L is t I t e m o b je c t s to th e c o n t r o l.
Dim itm X As L is t I t e m
' Add names to column 1 .
S e t itm X= L i s t V ie w 1 .L is t I t e m s .A d d ( 1 , " M a ry " , "M a ry ")
' Use th e S u b Ite m In d e x to a s s o c ia t e th e Su bItem w it h th e c o r r e c t
' Colum nH eader. Use th e key ( " A d d r e s s " ) to s p e c if y th e r ig h t
' Colum nH eader.
it m X .S u b It e m s (L is t V ie w 1 .C o lu m n H e a d e r s (" A d d r e s s " ).S u b It e m In d e x ) _
= "212 Grunge S t r e e t "
' Use th e Colum nHeader key to a s s o c ia t e th e S u b Ite m s s t r i n g
' w it h th e c o r r e c t Colum nH eader.
it m X .S u b It e m s (L is tV ie w 1 .C o lu m n H e a d e r s (" P h o n e " ).S u b It e m In d e x ) _
= "5 5 5 -1 2 1 2 "

S e t itm X = L is t V ie w 1 .L is t I t e m s .A d d ( 2 , " B ill" , " B ill" )


it m X .S u b It e m s (L is t V ie w 1 .C o lu m n H e a d e r s (" A d d r e s s " ).S u b It e m In d e x ) _
= "101 P a c i f i c Way"
it m X .S u b It e m s (L is tV ie w 1 .C o lu m n H e a d e r s (" P h o n e " ).S u b It e m In d e x ) _
= "5 5 5 -7 8 7 9 "

S e t itm X= L i s t V ie w 1 .L is t I t e m s .A d d ( 3 , " S u s a n " , " S u s a n " )


it m X .S u b It e m s (L is t V ie w 1 .C o lu m n H e a d e r s (" A d d r e s s " ).S u b It e m In d e x ) =
"8 0 0 C h ica g o S t r e e t "
it m X .S u b It e m s (L is tV ie w 1 .C o lu m n H e a d e r s (" P h o n e " ).S u b It e m In d e x ) = _
"5 5 5 -4 5 3 7 "

S e t itm X= L i s t V ie w 1 .L is t I t e m s .A d d ( 4 , "Tom ", "Tom ")


it m X .S u b It e m s (L is t V ie w 1 .C o lu m n H e a d e r s (" A d d r e s s " ).S u b It e m In d e x ) _
= "20 0 Ocean C i t y "
it m X .S u b It e m s (L is tV ie w 1 .C o lu m n H e a d e r s (" P h o n e " ).S u b It e m In d e x ) = _
"5 5 5 -0 3 4 8 "

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259713(v=vs.60).aspx 1/1
2. 1.2018 Subitems Property (ListView Control)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


V isu a l S tu d io 6 .0

SubItems Property (ListView Control)


See Also Example Applies To

Returns or sets an array of strings (a subitem) representing the L istIte m object's data in a L is tV ie w control.

S y n ta x

o b j e c t . SubItems(index) [= string]

The S u b Ite m s property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to a L istIte m object.

in d e x An integer that identifies a subitem for the specified ListIte m .

strin g Text that describes the subitem.

R e m a rks

Subitem s are arrays of strings representing the L istIte m object's data that are displayed in Report view. For exam ple, you
could show the file size and the date last modified for a file.

A L istIte m object can have any num ber of associated item data strings (subitem s) but each L istIte m object must have the
same num ber of subitems.

There are corresponding column headers defined for each subitem.

You cannot add elem ents directly to the subitem s array. Use the A d d method of the C o lu m n H e a d e rs collection to add
subitems.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa259714(v=vs.60).aspx 1/1
2. 1.2018 Add Method (ListItems, ColumnHeaders), SubItems Property Example

Visual Basic: Windows Controls


Add Method (ListItems, ColumnHeaders),
ListItems Property, SubItems Property
Example
The following exam ple uses the Biblio.m db database as a source to populate a L is tV ie w control with L istIte m objects. To try
this exam ple, place a L istV ie w control on a form and paste the code into the Declarations section. You must also be sure that
the Biblio.m db has been installed on yo ur m achine. In the code below, check the path in the O p e n D a tab ase function and
change it to reflect the actual path to Biblio.m db on yo ur machine.

N o te The exam ple will not run unless you add a reference to the M icrosoft DAO 3.51 Object Library. To do this, on the
P ro je c t menu click R e fe re n ce s. Search for M icrosoft DAO 3.51 Object Library and click the checkbox to select it.

P r iv a t e Sub F o rm _Lo a d ()
' Add C o lum nH ead ers. The w id th o f th e colum ns i s
' th e w id th o f th e c o n t r o l d iv id e d by th e number o f
' Colum nHeader o b je c t s .
L is tV ie w 1 .C o lu m n H e a d e rs . _
Add , , " A u t h o r " , L is t V ie w 1 .W id t h / 3
L is tV ie w 1 .C o lu m n H e a d e rs . _
Add , , "A u th o r I D " , L is t V ie w 1 .W id t h / 3 , _
lvw C o lu m n C en te r
L is tV ie w 1 .C o lu m n H e a d e rs . _
Add , , " B i r t h d a t e " , L is t V ie w 1 .W id t h / 3
' S e t V ie w p r o p e r ty to R e p o rt .
L is t V ie w 1 .V ie w = lv w R e p o rt

' D e c la r e o b je c t v a r i a b l e s f o r th e
' D ata A c c e s s o b je c t s .
Dim myDb As D a ta b a s e , myRs As R e c o rd s e t
' S e t th e D a ta b a se t o th e BIBLIO .M D B d a ta b a s e .
' IMPORTANT: th e B ib lio .m d b must be on y o u r
' m a ch in e , and you must s e t th e c o r r e c t p ath to
' th e f i l e in th e O penDatabase f u n c t io n b e lo w .
S e t myDb = D B E n g in e .W o rk s p a c e s (0 ) _
.O p e n D a ta b a s e ("c :\P ro g ra m F ile s \ V B \ B IB L IO .M D B " )
' S e t th e r e c o r d s e t to th e " A u th o rs " t a b l e .
S e t myRs = _
m y D b .O p e n R e c o rd s e t("A u th o rs " , dbO penD ynaset)

' D e c la r e a v a r i a b l e to add L is t I t e m o b je c t s .
Dim itm X As L is t I t e m

' W h ile th e re c o rd i s not th e l a s t r e c o r d ,


' add a L is t I t e m o b je c t . Use th e a u th o r f i e l d f o r
' th e L is t I t e m o b j e c t 's t e x t . Use th e A u th o rID
' f i e l d f o r th e L is t I t e m o b j e c t 's S u b It e m (1 ).
' Use th e " Y e a r o f B i r t h " f i e l d f o r th e L is t I t e m
' o b j e c t 's S u b It e m (2 ).

W h ile Not m yRs.EO F

https://msdn.microsoft.com/en-us/library/aa443210(v=vs.60).aspx 1/2
2. 1.2018 Add Method (ListItems, ColumnHeaders), SubItems Property Example

S e t itm X = L i s t V i e w 1 . L i s t I t e m s . _
A d d (, , C S t r ( m y R s !A u t h o r )) ' A u th o r.

' I f th e A u th o rID f i e l d i s no t n u l l , th e n s e t
' Su bItem 1 to i t .
I f Not Is N u ll( m y R s !A u _ id ) Then
it m X .S u b It e m s (1 ) = C S tr (m y R s !A u _ id )
End I f

' I f th e b i r t h f i e l d is no t N u l l , set
' Su bItem 2 to i t .
If Not Is N u ll( m y R s ! [ Y e a r B o r n ] ) Then
it m X .S u b It e m s (2 ) = m y R s ![Y e a r B o rn ]
End I f
m yRs.M oveNext ' Move to n e x t r e c o r d .
Wend
End Sub

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa443210(v=vs.60).aspx 2/2
2. 1.2018 SubPlotLabelPosition Property

This documentation is archived and is not being maintained.

V isu a l S tu d io 6 .0

Visual Basic: MSChart Control

SubPlotLabelPosition Property
See Also Example Applies To

Returns or sets the position used to display a label on each pie in a chart.

S y n ta x

o b /ecf.Sub Plo tLab elPo sitio n [ = pos]

The S u b P lo tL a b e lP o s itio n property syntax has these parts:

P a rt D e s c r ip tio n

o b ject An o b je c t expression th a t evaluates to an o b je ct in th e Applies To list.

p os In te g e r. A V tC hSubP lotLabelLocationType co n sta n t used to describe th e position o f th e ch a rt


label.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa229080(v=vs.60).aspx 1/1
2. 1.2018 SummaryCommandName Property

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

SummaryCommandName Property
See Also Example Applies To

Returns or sets the name of the sum m ary Recordset w hen the D EC o m m an d object is grouped.

S y n ta x

o b /ect.Sum m aryC o m m andN am e [= string]

The S u m m a ry C o m m a n d N a m e property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an item in the Applies To list.

strin g A string expression that specifies the name given to the sum m ary Recordset.

R e m a rks

This property is used when defining a group-based Comm and hierarchy. The name must be unique among all D EC o m m an d
and D E C o n n e ctio n objects w ithin the DataEnvironm ent object.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445716(v=vs.60).aspx 1/1
2. 1.2018 SupportsMnemonics Property

This documentation is archived and is not being maintained.

Visual Basic Reference


V isu a l S tu d io 6 .0

SupportsMnemonics Property
See Also Example Applies To

Returns a boolean value stating w hether the controls container handles access keys for the control.

S y n ta x

o b /ecf.SupportsM nem o nics

The S u p p o rtsM n e m o n ic s property syntax has this part:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

S e ttin g s

The possible boolean return values from the S u p p o rtsM n e m o n ic s property are:

S e ttin g D e scrip tio n

T ru e The container for the control does handle access keys.

False The container for the control does not handle access keys. If the container does not im plem ent this am bient
property, this will be the default value.

R e m a rks

Most containers of controls are capable of handling all the processing of access keys for the controls contained w ithin the
container. This includes figuring out which control is to be given a particular access key. If a container is not capable of
processing access keys, it is indicated with this S u p p o rtsM n e m o n ic s property, and the control can take action, such as not
displaying the underlined character as an indication of keyboard accelerators.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa445717(v=vs.60).aspx 1/1
2. 1.2018 SyncBuddy Property (Windows Controls)

This documentation is archived and is not being maintained.

Visual Basic: Windows Controls


V isu a l S tu d io 6 .0

SyncBuddy Property
See Also Example Applies To

Sets or returns a value that determ ines w hether the U p D o w n control synchronizes the V a lu e property with a property in the
buddy control.

S y n ta x

o b ject.SyncBu ddy [= value]

The S y n c B u d d y property syntax has these parts:

P a rt D e scrip tio n

o b je ct An object expression that evaluates to an object in the Applies To list.

value A boolean expression that determ ines w hether the buddy control synchronizes with the U p D o w n control, as
described in Settings.

S e ttin g s

The settings for va lue are:

S e ttin g D e scrip tio n

T ru e The U p D o w n control synchronizes the V a lu e property with a property of the buddy control, specified by the
B u d d y P ro p e rty property. If no property is specified in the B u d d y P ro p e rty property, then the default property
for the buddy control is used.

False (Default) The U p D o w n control doesn't synchronize the V a lu e property with a property in the buddy control.

R e m a rks

Use the S y n c B u d d y property to autom atically synchronize a property of the buddy control with the V a lu e property of the
U p D o w n control. For exam ple, you can synchronize the V a lu e property of the U p D o w n control with the T e x t property of a
T e x t B o x control. W henever the V a lu e property changes, it would update the T e x t property in the T e x t B o x control and vice
versa. You can also synchronize the V a lu e property of the U p D o w n control with other properties of a control such as the
T o p , Le ft, B a ck C o lo r, Fo re C o lo r, and others.

https://msdn.microsoft.com/en-us/Nbrary/aa276894(v=vs.60).aspx 1/2
2. 1.2018 SyncBuddy Property (Windows Controls)

To see a list of the available properties you can synchronize the V a lu e property with (after setting the B u d d yC o n tro l
property), select the B u d d y P ro p e rty property in the properties w indow or from the Properties Page.

© 2018 Microsoft

https://msdn.microsoft.com/en-us/library/aa276894(v=vs.60).aspx 2/2

You might also like