GetButtonIdForCustomButton() public static method

Gets the buttonId for a custom button.
When creating the config options for the dialog and specifying custom buttons, typically you pass in an array of button label strings. The index specifies which button to get an id for. If you passed in Save, Don't Save, and Cancel, then index 2 specifies the Cancel custom button.
public static GetButtonIdForCustomButton ( int index ) : int
index int The zero-based index into the array of custom buttons.
return int
 /// <summary>
 /// Sets the state of a custom button to enabled or disabled.
 /// </summary>
 /// <param name="index">The zero-based index of the button to set.</param>
 /// <param name="enabled"><c>true</c> to enable the button; <c>false</c> to disable</param>
 public void SetCustomButtonEnabledState(int index, bool enabled)
 {
     SetButtonEnabledState(TaskDialog.GetButtonIdForCustomButton(index), enabled);
 }
 /// <summary>
 /// Sets the elevation required state of a custom button, adding a shield icon.
 /// </summary>
 /// <param name="index">The zero-based index of the button to set.</param>
 /// <param name="elevationRequired"><c>true</c> to enable the button; <c>false</c> to disable</param>
 /// <remarks>
 /// Note that this is purely for visual effect. You will still need to perform
 /// the necessary code to trigger a UAC prompt for the user.
 /// </remarks>
 public void SetCustomButtonElevationRequiredState(int index, bool elevationRequired)
 {
     SetButtonElevationRequiredState(TaskDialog.GetButtonIdForCustomButton(index), elevationRequired);
 }
 /// <summary>
 /// Simulate the action of a custom button click in the TaskDialog.
 /// </summary>
 /// <param name="index">The zero-based index into the button set.</param>
 /// <returns>
 /// If the function succeeds the return value is true.
 /// </returns>
 public bool ClickCustomButton(int index)
 {
     return(ClickButton(TaskDialog.GetButtonIdForCustomButton(index)));
 }