Export (0) Print
Expand All

Visual Basic Reference

Visual Studio 6.0

Extender Object

See Also    Example    Properties    Methods    Events

An Extender object holds properties of the control that are actually controlled by the container of the control rather than by the control itself.

Syntax

Extender

Remarks

Some properties of a control are provided by the container rather than the control; these are extender properties. Examples of extender properties are: Name, Tag and Left. The control still needs to know what the value of these extender properties are, and sometimes needs to be able to change an extender property; the Extender object gives the control access to these properties.

Some extender properties are standard, while others are specific to certain containers. A control may access non-standard extender properties, but this will make the control container-specific. If the control makes use of an extender property, the control should handle the case where the extender property is not supported by the current container.

When the control is compiled, Visual Basic has no way of knowing what extender properties may be available when the control is run; therefore references to extender properties will always be late bound.

The Extender object is not available when the Initialize event is raised; but is available when the InitProperties event or ReadProperties event is raised.

The Extender object has several standard properties:

  • The Name property, a read only String that contains the user-defined name of the control.

  • The Visible property, a read/write Boolean that specifies if the control is visible or not.

  • The Parent property, a read only object that represents the container of the control, such as a form in Visual Basic.

  • The Cancel property, a read only Boolean that indicates that the control is the default Cancel button for the container.

  • The Default property, a read only Boolean that indicates that the control is the default button for the container.

Visual Basic provides several more extender methods, properties and events; other containers are not guaranteed to provide these extender methods, properties and events. These Visual Basic specific extender methods, properties and events are:

  • The Container property, a read only object that represents the visual container of the control.

  • The DragIcon property, a read/write Picture that specifies the icon to use when the control is dragged.

  • The DragMode property, a read/write Integer that specifies if the control will automatically drag, or if the user of the control must call the Drag method.

  • The Enabled property, a read only Boolean that specifies if the control is enabled. This extender property is not present unless the control also has an Enabled property with the correct procedure ID. For additional information, refer to the topic "Allowing Your Controls to be Enabled and Disabled" in Chapter 9: Building ActiveX Controls.

  • The Height property, a read/write Integer that specifies the height of the control in the containers scale units.

  • The HelpContextID property, a read/write Integer that specifies the context ID to use when the F1 key is pressed when the control has the focus.

  • The Index property, a read only Integer that specifies the position in a control array this instance of the control occupies.

  • The Left property, a read/write Integer that specifies the position of the left edge of the control to the left edge of the container, specified in the containers scale units.

  • The TabIndex property, a read/write Integer that specifies the position of the control in the tab order of the controls in the container.

  • The TabStop property, a read/write Boolean that specifies if Tab will stop on the control.

  • The Tag property, a read/write String that contains a user-defined value.

  • The ToolTipText property, a read/write String that contains the text to be displayed when the cursor hovers over the control for more than a second.

  • The Top property, a read/write Integer that specifies the position of the top edge of the control to the top edge of the container, specified in the containers scale units.

  • The WhatThisHelpID property, a read/write Integer that specifies the context ID to use when the Whats This pop-up is used on the control.

  • The Width property, a read/write Integer that specifies the width of the control in the containers scale units.

  • The Drag method, a method to begin, end, or cancel a drag operation of the control.

  • The Move method, a method to move the position of the control.

  • The SetFocus method, a method to set the focus to the control.

  • The ShowWhatsThis method, a method to display a selected topic in a Help file using the What's This popup provided by Help.

  • The ZOrder method, a method to place the control at the front or back of the z-order within its graphical level.

  • The DragDrop event, an event that is raised when another control on the form is dropped on this control.

  • The DragOver event, an event that is raised when another control on the form is dragged over this control.

  • The GotFocus event, an event that is raised when this control gets the focus.

  • The LostFocus event, an event that is raised when this control loses the focus.
Show:
© 2014 Microsoft