HeaderPane
Main
Hide
Share Link
Print

Buttons Property, SftTaskDialogPage Class

Defines the buttons and command links of the page.

Class: SftTaskDialogPage
Namespace: Softelvdm.SftStyleNET
Assembly: Softelvdm.SftStyleNET

Syntax

public SftTaskDialogButtonCollection Buttons { get; set; }
Public Property Buttons As SftTaskDialogButtonCollection

Value

The collection of buttons. Command links appear in the content area, the other buttons at the bottom right. Without buttons the page shows an OK button. The collection cannot be replaced or changed while the page is shown.

Comments

Defines the buttons and command links of the page.

Examples

C# View entire sample code

            SftTaskDialogPage page = new SftTaskDialogPage {
                Caption = "Unsaved orders",
                Heading = "What do you want to do with the 3 unsaved orders?",
                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) {

VB.NET View entire sample code

    Private Sub ButtonTaskDialog_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ButtonTaskDialog.Click
        Dim page As New SftTaskDialogPage()
        page.Caption = "Unsaved orders"
        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

See Also SftTaskDialogPage Class | Classes | SftStyle/NET 3.0