BuddyControl Property

       

Sets or returns the control used as the buddy control.

Syntax

object.BuddyControl [= value]

The BuddyControl property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
value A variant value that specifies the buddy control, as described below.

Remarks

The BuddyControl property can be set at design time or at run time. At run time, BuddyControl property in the Properties window. To set the BuddyControl property at run time, use the following code:

UpDown1.BuddyControl = Text1

You can also implicitly set the BuddyControl property by setting AutoBuddy to True. In this case, the BuddyControl is automatically set to the previous control in the tab order.

Setting the BuddyControl property to Nothing automatically sets the AutoBuddy setting to False.

Note   Setting the BuddyControl property to a control that cannot be a buddy, such as the intrinsic label control, results in an error.