コード例 #1
0
        private void OnAllFeaturesButtonClick(NEventArgs arg)
        {
            NTaskDialog taskDialog = NTaskDialog.Create(OwnerWindow);

            taskDialog.Title = "Task Dialog";

            // Add header and content
            taskDialog.Header  = new NTaskDialogHeader(ENMessageBoxIcon.Information, "This is the header.");
            taskDialog.Content = new NLabel("This is the content.");

            // Add some radio buttons and custom buttons
            taskDialog.RadioButtonGroup = new NTaskDialogRadioButtonGroup("Radio Button 1",
                                                                          "Radio Button 2", "Radio Button 3");
            taskDialog.CustomButtons = new NTaskDialogCustomButtonCollection("Custom Button 1",
                                                                             "Custom Button 2", "Custom Button 3");

            // Set the common buttons
            taskDialog.Buttons = ENTaskDialogButton.OK | ENTaskDialogButton.Cancel;

            // Add a verification check box and a footer
            taskDialog.VerificationCheckBox = new NCheckBox("This is the verification check box.");
            taskDialog.Footer = new NLabel("This is the footer.");

            // Subscribe to the Closed event and open the task dialog
            taskDialog.Closed += OnTaskDialogClosed;
            taskDialog.Open();
        }
コード例 #2
0
        private void OnRadioButtonsButtonClick(NEventArgs arg)
        {
            NTaskDialog taskDialog = NTaskDialog.Create(OwnerWindow);

            taskDialog.Title            = "Task Dialog";
            taskDialog.Header           = new NTaskDialogHeader(ENMessageBoxIcon.Information, "This is a task dialog with radio buttons.");
            taskDialog.RadioButtonGroup = new NTaskDialogRadioButtonGroup("Radio Button 1", "Radio Button 2");
            taskDialog.Buttons          = ENTaskDialogButton.OK;

            // Subscribe to the Closed event and open the task dialog
            taskDialog.Closed += OnTaskDialogClosed;
            taskDialog.Open();
        }
コード例 #3
0
        private void OnCustomButtonsButtonClick(NEventArgs arg)
        {
            NTaskDialog taskDialog = NTaskDialog.Create(OwnerWindow);

            taskDialog.Title         = "Task Dialog";
            taskDialog.Header        = new NTaskDialogHeader(ENMessageBoxIcon.Information, "This is a task dialog with custom buttons.");
            taskDialog.CustomButtons = new NTaskDialogCustomButtonCollection("Custom Button 1",
                                                                             "Custom Button 2", "Custom Button 3");

            // Subscribe to the Closed event and open the task dialog
            taskDialog.Closed += OnTaskDialogClosed;
            taskDialog.Open();
        }
コード例 #4
0
        private void OnVerificationButtonClick(NEventArgs arg)
        {
            NTaskDialog taskDialog = NTaskDialog.Create(OwnerWindow);

            taskDialog.Title   = "Task Dialog";
            taskDialog.Header  = new NTaskDialogHeader(ENMessageBoxIcon.Information, "This is the header.");
            taskDialog.Content = new NLabel("This is the content.");
            taskDialog.VerificationCheckBox = new NCheckBox("This is the verification check box.");
            taskDialog.Buttons = ENTaskDialogButton.OK | ENTaskDialogButton.Cancel;

            // Subscribe to the Closed event and open the task dialog
            taskDialog.Closed += OnTaskDialogClosed;
            taskDialog.Open();
        }
コード例 #5
0
        private void OnMessageBoxLikeButtonClick(NEventArgs arg)
        {
            NTaskDialog taskDialog = NTaskDialog.Create(OwnerWindow);

            taskDialog.Title   = "Task Dialog";
            taskDialog.Header  = new NTaskDialogHeader(ENMessageBoxIcon.Question, "Do you want to save the changes?");
            taskDialog.Buttons = ENTaskDialogButton.Yes | ENTaskDialogButton.No | ENTaskDialogButton.Cancel;

            // Change the texts of the Yes and No buttons
            NStackPanel stack = taskDialog.ButtonStrip.GetPredefinedButtonsStack();
            NLabel      label = (NLabel)stack[0].GetFirstDescendant(NLabel.NLabelSchema);

            label.Text = "Save";

            label      = (NLabel)stack[1].GetFirstDescendant(NLabel.NLabelSchema);
            label.Text = "Don't Save";

            // Subscribe to the Closed event and open the task dialog
            taskDialog.Closed += OnTaskDialogClosed;
            taskDialog.Open();
        }
コード例 #6
0
        private void OnAdvancedCustomButtonsButtonClick(NEventArgs arg)
        {
            NTaskDialog taskDialog = NTaskDialog.Create(OwnerWindow);

            taskDialog.Title   = "Task Dialog";
            taskDialog.Header  = new NTaskDialogHeader(ENMessageBoxIcon.Information, "This is a task dialog with custom buttons.");
            taskDialog.Content = new NLabel("These custom buttons contain a symbol/image, a title and a description.");

            // Create some custom buttons
            taskDialog.CustomButtons = new NTaskDialogCustomButtonCollection();
            taskDialog.CustomButtons.Add(new NTaskDialogCustomButton("Title Only"));
            taskDialog.CustomButtons.Add(new NTaskDialogCustomButton("Title and Description", "This button has a title and a description."));
            taskDialog.CustomButtons.Add(new NTaskDialogCustomButton(NTaskDialogCustomButton.CreateDefaultSymbol(),
                                                                     "Symbol, Title, and Description", "This button has a symbol, a title and a description."));
            taskDialog.CustomButtons.Add(new NTaskDialogCustomButton(NResources.Image__16x16_Mail_png,
                                                                     "Image, Title and Description", "This button has an icon, a title and a description."));

            // Subscribe to the Closed event and open the task dialog
            taskDialog.Closed += OnTaskDialogClosed;
            taskDialog.Open();
        }