Skip to content

AddButton Method

Description

Adds a user-defined button to the task dialog's command area.

Syntax

Public Sub AddButton( _
    ByVal [Text] As String, _
    ByVal [Id] As Long _
)

Parameters

  • Text: String to be used to label the button.
  • Id: Indicates the value to be returned when this button is selected and the ButtonClicked event fires.

Remarks

AddButton adds a user-defined button to the task dialog's command area.

The illustration below shows two user-defined buttons that have been added:

User Defined Buttons

Notes:

  • 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:

Command Links

  • 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.

  • 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.

  • 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.

See Also


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.