ClickButton Method
Description
Simulate the action of a button click in the task dialog.
Syntax
Public Sub ClickButton( _
ByVal [Id](#) As Long _
)
Parameters
- Id: Indicates the button ID to be selected/clicked.
Remarks
ClickButton should only be called after the dialog has been Constructed.
The ClickButton method can be used to simulate the action of a button click in the task dialog and will cause the ButtonClicked event to fire.

Notes:
- The ButtonClicked event occurs when a button is clicked and is used to determine which button was selected.
- The AddButton method is used to add buttons.
- AddButton adds a user-defined button to the task dialog's command area.
- DefaultButton may be any of the values specified when calling the AddButton method. If DefaultButton is zero or its value does not correspond to any button ID in the dialog, then the first button in the dialog will be the default.
- EnableCommandLinks specifies whether the buttons specified with AddButton should be displayed as command links (using a standard task dialog glyph) instead of push buttons. When using command links, all characters up to the first new line character in AddButton's Text argument will be treated as the command link's main text, and the remainder will be treated as the command link's note text.
The illustration below shows command links without icons:

See Also
- TaskDialog Control
- AddButton Method
- EnableCommandLinks Property
- DefaultButton Property
- CommonButtons Property
- ButtonClicked Event
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.