HeaderPane
Main
Hide
Share Link
Print

SftTaskDialogButton Class

Represents a button of a task dialog.

The static properties return new instances of the standard buttons, whose text comes in the language of Windows. A standard button is equal to any other instance of the same standard button, with the == and != operators as with Equals, so the result of SftTaskDialog.ShowDialog can be compared with SftTaskDialogButton.Cancel. A custom button is equal only to itself. The standard buttons appear in the order of the Windows task dialog, after the custom buttons.

Namespace: Softelvdm.SftStyleNET
Assembly: Softelvdm.SftStyleNET

Inheritance

Syntax

public class SftTaskDialogButton : Softelvdm.SftStyleNET.SftTaskDialogControl;
Public Class SftTaskDialogButton
    Inherits Softelvdm.SftStyleNET.SftTaskDialogControl

Constructors

PublicSftTaskDialogButtonInitializes a new instance of the SftTaskDialogButton class.

Properties

PublicStaticAbortReturns a new Abort button.
PublicAllowCloseDialogDefines whether clicking the button closes the dialog.
PublicInherited from Softelvdm.SftStyleNET.SftTaskDialogControlBoundPageReturns the page the element belongs to while the page is shown.
PublicStaticCancelReturns a new Cancel button.
PublicStaticCloseReturns a new Close button.
PublicStaticContinueReturns a new Continue button.
PublicEnabledDefines whether the button can be clicked.
PublicStaticHelpReturns a new Help button, which raises the SftTaskDialogPage.HelpRequest event of the page and does not close the dialog.
PublicStaticIgnoreReturns a new Ignore button.
PublicStaticNoReturns a new No button.
PublicStaticOKReturns a new OK button.
PublicStaticRetryReturns a new Retry button.
PublicShowShieldIconDefines whether the button shows the shield icon, which tells the user that the action needs elevated rights.
PublicInherited from Softelvdm.SftStyleNET.SftTaskDialogControlTagDefines an object with data about the element.
PublicTextDefines the text of the button.
PublicStaticTryAgainReturns a new Try Again button.
PublicVisibleDefines whether the button is shown.
PublicStaticYesReturns a new Yes button.

Methods

PublicEqualsReturns whether the object is the same button, or the same standard button.
ProtectedInherited from System.ObjectFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
PublicGetHashCodeReturns a hash code for the button.
PublicInherited from System.ObjectGetTypeGets the Type of the current instance.
ProtectedInherited from System.ObjectMemberwiseCloneCreates a shallow copy of the current Object.
PublicPerformClickClicks the button, as the user would, while its page is shown.
PublicStaticInherited from System.ObjectReferenceEqualsDetermines whether the specified Object instances are the same instance.
PublicToStringReturns the text of the button.

Events

PublicClickOccurs when the button is clicked.

Examples

C# View entire sample code

                Icon = SftTaskDialogIcon.Warning,
                Verification = new SftTaskDialogVerificationCheckBox("&Do not ask again"),
                Expander = new SftTaskDialogExpander("Order 1042, Order 1044 and Order 1045 have changes that are not saved."),
                Footnote = new SftTaskDialogFootnote("Drafts are kept for 30 days."),
            };
            page.Buttons.Add(new SftTaskDialogCommandLinkButton("&Save the orders", "They are saved as drafts and can be completed later."));
            page.Buttons.Add(new SftTaskDialogCommandLinkButton("D&iscard the orders", "The changes are lost."));
            page.Buttons.Add(SftTaskDialogButton.Cancel);
            SftTaskDialogButton clicked = SftTaskDialog.ShowDialog(this, page);
            labelResult.Text = "Task dialog: " + (clicked == null ? "closed" : clicked.Text.Replace("&", "")) + (page.Verification.Checked ? ", do not ask again" : "");
        }

        private void buttonColorDialog_Click(object sender, EventArgs e) {
            sftColorDialog1.Color = panelColor.BackColor;
            if (sftColorDialog1.ShowDialog(this) == DialogResult.OK) {
                panelColor.BackColor = sftColorDialog1.Color;

VB.NET View entire sample code

        page.Heading = "What do you want to do with the 3 unsaved orders?"
        page.Icon = SftTaskDialogIcon.Warning
        page.Verification = New SftTaskDialogVerificationCheckBox("&Do not ask again")
        page.Expander = New SftTaskDialogExpander("Order 1042, Order 1044 and Order 1045 have changes that are not saved.")
        page.Footnote = New SftTaskDialogFootnote("Drafts are kept for 30 days.")
        page.Buttons.Add(New SftTaskDialogCommandLinkButton("&Save the orders", "They are saved as drafts and can be completed later."))
        page.Buttons.Add(New SftTaskDialogCommandLinkButton("D&iscard the orders", "The changes are lost."))
        page.Buttons.Add(SftTaskDialogButton.Cancel)
        Dim clicked As SftTaskDialogButton = SftTaskDialog.ShowDialog(Me, page)
        Dim text As String = "closed"
        If clicked IsNot Nothing Then
            text = clicked.Text.Replace("&", "")
        End If
        If page.Verification.Checked Then
            text += ", do not ask again"
        End If

See Also Classes | SftStyle/NET 3.0