SYMPTOMS
When you attempt to set the Tag property of an object in the Comctl32.ocx
ActiveX Control, you will receive run-time error 424:
"Object required"
The following examples cause the error:
Set TabStrip1.Tabs(1).Tag = Text1
Set Toolbar1.Buttons(1).Tag = Text1
Set StatusBar1.Panels(1).Tag = Text1
Set TreeView1.Nodes(1).Tag = Text1
Set ListView1.ListItems(1).Tag = Text1
Set ImageList1.ListImages(1).Tag = Text1
If you assign an object to one of these Tag properties without using the
"Set" statement, the default property of the object is correctly assigned
to the Tag property. For instance, the following examples result in the
Text property of Text1 being assigned to the Tag properties:
TabStrip1.Tabs(1).Tag = Text1
Toolbar1.Buttons(1).Tag = Text1
StatusBar1.Panels(1).Tag = Text1
TreeView1.Nodes(1).Tag = Text1
ListView1.ListItems(1).Tag = Text1
ImageList1.ListImages(1).Tag = Text1
If the object you are assigning to the Tag property with this method does
not have a default property, you correctly get error 438 "Object doesn't
support this property or method." The following examples would result in
this error because forms do not have default properties:
TabStrip1.Tabs(1).Tag = Me
Toolbar1.Buttons(1).Tag = Me
StatusBar1.Panels(1).Tag = Me
TreeView1.Nodes(1).Tag = Me
ListView1.ListItems(1).Tag = Me
ImageList1.ListImages(1).Tag = Me
If the object you are assigning to the Tag property with this method is un-
initialized, Visual Basic incorrectly attempts to navigate to the default
property, which causes a crash. The following examples will cause an
"Application error" under NT 4.0, or a "This Program has performed an
illegal operation" error under Windows 95, Windows 98, or Windows Me:
Dim t As TextBox
TabStrip1.Tabs(1).Tag = t
Toolbar1.Buttons(1).Tag = t
StatusBar1.Panels(1).Tag = t
TreeView1.Nodes(1).Tag = t
ListView1.ListItems(1).Tag = t
ImageList1.ListImages(1).Tag = t
Similarly, setting the Tag property to "Nothing" causes the same crash.