Пример #1
0
        private void dialogError_ButtonClick(object sender, TaskDialogButtonClickEventArgs e)
        {
            if (e.DialogResult == TaskDialogResult.Custom &&
                e.CustomButton.Name == "sendButton")
            {
                C1TaskDialog sendDialog = new C1TaskDialog();
                sendDialog.WindowTitle         = "Send Feedback Dialog";
                sendDialog.Content             = "Sending your feedback .....";
                sendDialog.ProgressBar.Maximum = 5000;
                sendDialog.ProgressBar.Visible = true;
                sendDialog.EnableTimer         = true;
                sendDialog.TimerTick          += new TaskDialogTimerTickEventHandler(sendDialog_TimerTick);

                sendDialog.Show();
                sendDialog.Dispose();
            }
        }
Пример #2
0
 private void dialogEnableDisable_ButtonClick(object sender, TaskDialogButtonClickEventArgs e)
 {
     if (e.DialogResult == TaskDialogResult.Custom)
     {
         CustomButtonCollection cbc = dialogEnableDisable.CustomButtons;
         if (e.CustomButton.Name == "enableButton")
         {
             dialogEnableDisable.RadioButtons[0].Enabled = true;
             cbc["enableButton"].Enabled  = false;
             cbc["disableButton"].Enabled = true;
         }
         else if (e.CustomButton.Name == "disableButton")
         {
             dialogEnableDisable.RadioButtons[0].Enabled = false;
             cbc["enableButton"].Enabled  = true;
             cbc["disableButton"].Enabled = false;
         }
         e.Cancel = true;
     }
 }
Пример #3
0
        private void dialogCustomButtons_ButtonClick(object sender, TaskDialogButtonClickEventArgs e)
        {
            if (e.DialogResult == TaskDialogResult.Custom)
            {
                switch (e.CustomButton.Name)
                {
                case "Button1":
                    MessageBox.Show("Custom button 1 was clicked.", "Custom Buttons Sample");
                    e.Cancel = true;
                    break;

                case "Button2":
                    MessageBox.Show("Custom button 2 was clicked.", "Custom Buttons Sample");
                    e.Cancel = true;
                    break;

                case "Button3":
                    MessageBox.Show("Custom close button was clicked. Closing the dialog...", "Custom Buttons Sample");
                    break;
                }
            }
        }