INFO: Tab Keyword Cannot Be Used as Object Type in Visual Basic (150185)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q150185 SUMMARY
The TabStrip control contains an object, Tab, which supports the various
properties of a tab in the control. The word Tab cannot be used in a
declaration to dimension an object. This is because Tab is a keyword in
Visual Basic.
STATUS
This is by design. Since Tab is a keyword in Visual Basic, it cannot be
used in a declaration without employing one of the workarounds documented
below.
WORKAROUND
There are several ways to dimension a Tab object, which is part of the
TabStrip control:
Steps to Reproduce Problem- Create a new project in Visual Basic. Form1 is created by default.
Add a TabStrip control to a form.
- In the Form_Load event place the following code:
Private Sub Form_Load()
Dim x As Tab
End Sub
- Run the project by pressing F5. Visual Basic will correctly highlight
the dimension statement and report a Syntax Error.
Modification Type: | Major | Last Reviewed: | 6/24/2004 |
---|
Keywords: | kbinfo KB150185 |
---|
|