当前位置: 首页>>代码示例>>C#>>正文


C# MessageBoxForm.ShowDialog方法代码示例

本文整理汇总了C#中MessageBoxForm.ShowDialog方法的典型用法代码示例。如果您正苦于以下问题:C# MessageBoxForm.ShowDialog方法的具体用法?C# MessageBoxForm.ShowDialog怎么用?C# MessageBoxForm.ShowDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MessageBoxForm的用法示例。


在下文中一共展示了MessageBoxForm.ShowDialog方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

		private static void Main()
		{

			try
			{
				AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
				Application.ThreadException += Application_ThreadException;
			 
				bool result;
				var mutex = new Mutex(true, "Vixen3RunningInstance", out result);

				if (!result)
				{
					//messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
					MessageBoxForm.msgIcon = SystemIcons.Warning; //this is used if you want to add a system icon to the message form.
					var messageBox = new MessageBoxForm("Another instance is already running; please close that one before trying to start another.",
									"Vixen 3 already active", false, false);
					messageBox.ShowDialog();
					return;
				}

				Application.EnableVisualStyles();
				Application.SetCompatibleTextRenderingDefault(false);
				Application.Run(new VixenApplication());

				// mutex shouldn't be released - important line
				GC.KeepAlive(mutex);
			}
			catch (Exception ex)
			{
				Logging.Fatal(ErrorMsg, ex);
				Environment.Exit(1);
			}
		}
开发者ID:stewmc,项目名称:vixen,代码行数:34,代码来源:Program.cs

示例2: buttonOK_Click

		private void buttonOK_Click(object sender, EventArgs e)
		{
			if (dateStart.Value > dateStop.Value)
			{
				//messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
				MessageBoxForm.msgIcon = SystemIcons.Error; //this is used if you want to add a system icon to the message form.
				var messageBox = new MessageBoxForm("The end date of a show must fall after the start date.", "Date Error", false, true);
				messageBox.ShowDialog();
				return;
			}
			_scheduleItem.StartDate = dateStart.Value;
			_scheduleItem.EndDate = dateStop.Value;
			_scheduleItem.Sunday = checkSunday.Checked;
			_scheduleItem.Monday = checkMonday.Checked;
			_scheduleItem.Tuesday = checkTuesday.Checked;
			_scheduleItem.Wednesday = checkWednesday.Checked;
			_scheduleItem.Thursday = checkThursday.Checked;
			_scheduleItem.Friday = checkFriday.Checked;
			_scheduleItem.Saturday = checkSaturday.Checked;
			_scheduleItem.StartTime = dateStartTime.Value;
			_scheduleItem.EndTime = dateEndTime.Value;
			_scheduleItem.Enabled = checkEnabled.Checked;

			if (comboBoxShow.SelectedIndex >= 0)
			{
				Shows.Show show = ((comboBoxShow.SelectedItem as Common.Controls.ComboBoxItem).Value) as Shows.Show;
				_scheduleItem.ShowID = show.ID;
			}
			DialogResult = System.Windows.Forms.DialogResult.OK;
			Close();
		}
开发者ID:stewmc,项目名称:vixen,代码行数:31,代码来源:SetupScheduleForm.cs

示例3: Show

 public DialogResult Show(IWin32Window parent, string message, string caption, MessageBoxButton button, MessageBoxIcon icon)
 {
     using(var msgbox = new MessageBoxForm(button, icon, message, caption))
     {
         return msgbox.ShowDialog(parent);
     }
 }
开发者ID:Kuzq,项目名称:gitter,代码行数:7,代码来源:CustomMessageBoxService.cs

示例4: Setup

		public override bool Setup()
		{
			//messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
			MessageBoxForm.msgIcon = SystemIcons.Information; //this is used if you want to add a system icon to the message form.
			var messageBox = new MessageBoxForm("Nothing to Setup", "", false, false);
			messageBox.ShowDialog();
			return base.Setup();
		}
开发者ID:stewmc,项目名称:vixen,代码行数:8,代码来源:OpenDMXInstance.cs

示例5: buttonOK_Click

 private void buttonOK_Click(object sender, EventArgs e)
 {
     if (_PortAddress == 0)
     {
         //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
         MessageBoxForm.msgIcon = SystemIcons.Hand; //this is used if you want to add a system icon to the message form.
         var messageBox = new MessageBoxForm("The port address is 0.", "595 Setup", false, false);
         messageBox.ShowDialog();
         messageBox.DialogResult = DialogResult.None;
     }
     else {
         _data.Port = _PortAddress;
     }
 }
开发者ID:naztrain,项目名称:vixen,代码行数:14,代码来源:SetupDialog.cs

示例6: buttonOK_Click

 private void buttonOK_Click(object sender, EventArgs e)
 {
     if (TemplateName.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0) {
         //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
         MessageBoxForm.msgIcon = SystemIcons.Error; //this is used if you want to add a system icon to the message form.
         var messageBox = new MessageBoxForm("The template name must be a valid file name. Please ensure there are no invalid characters in the template name.",
             "Invalid Template Name", false, true);
         messageBox.ShowDialog();
         DialogResult = messageBox.DialogResult;
     }
     else {
         DialogResult = DialogResult.OK;
         Close();
     }
 }
开发者ID:naztrain,项目名称:vixen,代码行数:15,代码来源:PreviewCustomCreateForm.cs

示例7: buttonAddColorSet_Click

        private void buttonAddColorSet_Click(object sender, EventArgs e)
        {
            using (TextDialog textDialog = new TextDialog("New Color Set name?", "New Color Set")) {
                if (textDialog.ShowDialog() == DialogResult.OK) {
                    string newName = textDialog.Response;

                    if (_data.ContainsColorSet(newName)) {
                        //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
                        MessageBoxForm.msgIcon = SystemIcons.Error; //this is used if you want to add a system icon to the message form.
                        var messageBox = new MessageBoxForm("Color Set already exists.", "Error", false, false);
                        messageBox.ShowDialog();
                        return;
                    }

                    ColorSet newcs = new ColorSet();
                    _data.SetColorSet(newName, newcs);
                    UpdateGroupBoxWithColorSet(newName, newcs);
                    UpdateColorSetsList();
                }
            }
        }
开发者ID:jaredb7,项目名称:vixen,代码行数:21,代码来源:ColorSetsSetupForm.cs

示例8: buttonAddProfile_Click

        private void buttonAddProfile_Click(object sender, EventArgs e)
        {
            SaveCurrentItem();

            TextDialog dialog = new TextDialog("Enter a name for the new profile","Profile Name","New Profile");

            while (dialog.ShowDialog() == DialogResult.OK)
            {
                if (dialog.Response == string.Empty)
                {
                    //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
                    MessageBoxForm.msgIcon = SystemIcons.Error; //this is used if you want to add a system icon to the message form.
                    var messageBox = new MessageBoxForm("Profile name can not be blank.",
                        "Error", false, false);
                    messageBox.ShowDialog();
                }

                if (comboBoxProfiles.Items.Cast<ProfileItem>().Any(items => items.Name == dialog.Response))
                {
                    //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
                    MessageBoxForm.msgIcon = SystemIcons.Warning; //this is used if you want to add a system icon to the message form.
                    var messageBox = new MessageBoxForm("A profile with the name " + dialog.Response + @" already exists.", "", false, false);
                    messageBox.ShowDialog();
                }

                if (dialog.Response != string.Empty && comboBoxProfiles.Items.Cast<ProfileItem>().All(items => items.Name != dialog.Response))
                {
                    break;
                }

            }

            if (dialog.DialogResult == DialogResult.Cancel)
                return;

            ProfileItem item = new ProfileItem { Name = dialog.Response, DataFolder = _defaultFolder + " " + dialog.Response };
            comboBoxProfiles.Items.Add(item);
            comboBoxProfiles.SelectedIndex = comboBoxProfiles.Items.Count - 1;
            PopulateLoadProfileSection(false);
        }
开发者ID:naztrain,项目名称:vixen,代码行数:40,代码来源:DataProfileForm.cs

示例9: OkButton_Click

		private void OkButton_Click(object sender, EventArgs e)
		{
			if (portComboBox.SelectedIndex == _OtherAddressIndex) {
				if (PortAddress != 0) {
					try {
						Convert.ToUInt16(portTextBox.Text, 0x10);
					}
					catch {
						//messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
						MessageBoxForm.msgIcon = SystemIcons.Hand; //this is used if you want to add a system icon to the message form.
						var messageBox = new MessageBoxForm("The port number is not a valid hexadecimal number.", "Parallel Port Setup", false, false);
						messageBox.ShowDialog();
						base.DialogResult = DialogResult.None;
					}
				}
				else {
					//messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
					MessageBoxForm.msgIcon = SystemIcons.Hand; //this is used if you want to add a system icon to the message form.
					var messageBox = new MessageBoxForm("The port address is 0.", "Parallel Port Setup", false, false);
					messageBox.ShowDialog();
					DialogResult = DialogResult.None;
				}
			}
		}
开发者ID:stewmc,项目名称:vixen,代码行数:24,代码来源:ParallelPortConfig.cs

示例10: TimedSequenceEditorEffectEditor

        public TimedSequenceEditorEffectEditor(IEnumerable<EffectNode> effectNodes)
            : this(effectNodes.First())
        {
            if (effectNodes != null && effectNodes.Count() > 1) {
                _effectNodes = effectNodes;
                Text = "Edit Multiple Effects";

                // show a warning if multiple effect types are selected
                EffectNode displayedEffect = effectNodes.First();
                if (displayedEffect != null) {
                    foreach (EffectNode node in effectNodes) {
                        if (node.Effect.TypeId != displayedEffect.Effect.TypeId)
                        {
                            //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
                            MessageBoxForm.msgIcon = SystemIcons.Warning; //this is used if you want to add a system icon to the message form.
                            var messageBox = new MessageBoxForm("The selected effects contain multiple types. Once you finish editing, these values will " +
                                            "only be applied to the effects of type '" + displayedEffect.Effect.Descriptor.TypeName + "'.", "Warning", false, false);
                            messageBox.ShowDialog();
                            break;
                        }
                    }
                }
            }
        }
开发者ID:naztrain,项目名称:vixen,代码行数:24,代码来源:TimedSequenceEditorEffectEditor.cs

示例11: EditValue

		public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
		{
			IWindowsFormsEditorService svc = (IWindowsFormsEditorService)
			                                 provider.GetService(typeof (IWindowsFormsEditorService));
			if (svc != null) {
				List<PreviewBaseShape> shapes = value as List<PreviewBaseShape>;
				if (shapes.Count < 1)
				{
					//messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
					MessageBoxForm.msgIcon = SystemIcons.Error; //this is used if you want to add a system icon to the message form.
					var messageBox = new MessageBoxForm("Elements must have at least one shape. Remove the selected element.", "Error", false, false);
					messageBox.ShowDialog();
					if (value != null) return value;
				}
				PreviewSetElements elementsDialog = new PreviewSetElements(shapes);
				svc.ShowDialog(elementsDialog);
				// update etc
                if (shapes[0].Parent != null)
                {
                    shapes[0].Parent.Layout();
                }
			}
			return value;
		}
开发者ID:stewmc,项目名称:vixen,代码行数:24,代码来源:PreviewSetElementsUIEditor.cs

示例12: AddCurveToLibrary

		private void AddCurveToLibrary(Curve c, bool edit=true)
		{
			Common.Controls.TextDialog dialog = new Common.Controls.TextDialog("Curve name?");

			while (dialog.ShowDialog() == DialogResult.OK)
			{
				if (dialog.Response == string.Empty)
				{
					//messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
					var messageBox = new MessageBoxForm("Please enter a name.", "Curve Name", false, false);
					messageBox.ShowDialog();
					continue;
				}

				if (_curveLibrary.Contains(dialog.Response))
				{
					//messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
					MessageBoxForm.msgIcon = SystemIcons.Question; //this is used if you want to add a system icon to the message form.
					var messageBox = new MessageBoxForm("There is already a curve with that name. Do you want to overwrite it?", "Overwrite curve?", true, true);
					messageBox.ShowDialog();
					if (messageBox.DialogResult == DialogResult.OK)
					{
						_curveLibrary.AddCurve(dialog.Response, c);
						if (edit)
						{
							_curveLibrary.EditLibraryCurve(dialog.Response);	
						}
						break;
					}

					if (messageBox.DialogResult == DialogResult.Cancel)
					{
						break;
					}
				}
				else
				{
					_curveLibrary.AddCurve(dialog.Response, c);
					if (edit)
					{
						_curveLibrary.EditLibraryCurve(dialog.Response);	
					}
					
					break;
				}
			}
		}
开发者ID:stewmc,项目名称:vixen,代码行数:47,代码来源:Form_ToolPalette.cs

示例13: AddGradientToLibrary

		private void AddGradientToLibrary(ColorGradient cg, bool edit = true)
		{
			Common.Controls.TextDialog dialog = new Common.Controls.TextDialog("Gradient name?");

			while (dialog.ShowDialog() == DialogResult.OK)
			{
				if (dialog.Response == string.Empty)
				{
					//messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
					MessageBoxForm.msgIcon = SystemIcons.Error; //this is used if you want to add a system icon to the message form.
					var messageBox = new MessageBoxForm("Please enter a name.", "Warning", false, false);
					messageBox.ShowDialog();
					continue;
				}

				if (_colorGradientLibrary.Contains(dialog.Response))
				{
					//messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
					MessageBoxForm.msgIcon = SystemIcons.Warning; //this is used if you want to add a system icon to the message form.
					var messageBox = new MessageBoxForm("There is already a gradient with that name. Do you want to overwrite it?", "Overwrite gradient?", true, true);
					messageBox.ShowDialog();
					if (messageBox.DialogResult == DialogResult.OK)
					{
						_colorGradientLibrary.AddColorGradient(dialog.Response, cg);
						if (edit)
						{
							_colorGradientLibrary.EditLibraryItem(dialog.Response);	
						}
						break;
					}

					if (messageBox.DialogResult == DialogResult.Cancel)
					{
						break;
					}
				}
				else
				{
					_colorGradientLibrary.AddColorGradient(dialog.Response, cg);
					if (edit)
					{
						_colorGradientLibrary.EditLibraryItem(dialog.Response);	
					}
					break;
				}
			}
		}
开发者ID:stewmc,项目名称:vixen,代码行数:47,代码来源:Form_ToolPalette.cs

示例14: toolStripButtonDeleteGradient_Click

		private void toolStripButtonDeleteGradient_Click(object sender, EventArgs e)
		{
			if (listViewGradients.SelectedItems.Count == 0)
				return;

			//messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
			MessageBoxForm.msgIcon = SystemIcons.Warning; //this is used if you want to add a system icon to the message form.
			var messageBox = new MessageBoxForm("If you delete this library gradient, ALL places it is used will be unlinked and will" +
								@" become independent gradients. Are you sure you want to continue?", "Delete library gradient?", true, true);
			messageBox.ShowDialog();

			if (messageBox.DialogResult == DialogResult.OK)
			{
				_colorGradientLibrary.RemoveColorGradient(listViewGradients.SelectedItems[0].Name);
			}
		}
开发者ID:stewmc,项目名称:vixen,代码行数:16,代码来源:Form_ToolPalette.cs

示例15: toolStripButtonExportGradients_Click

		private void toolStripButtonExportGradients_Click(object sender, EventArgs e)
		{
			SaveFileDialog saveFileDialog = new SaveFileDialog
			{
				DefaultExt = ".vgl",
				Filter = @"Vixen 3 Color Gradient Library (*.vgl)|*.vgl|All Files (*.*)|*.*"
			};

			if (_lastFolder != string.Empty) saveFileDialog.InitialDirectory = _lastFolder;
			if (saveFileDialog.ShowDialog() != DialogResult.OK) return;
			_lastFolder = Path.GetDirectoryName(saveFileDialog.FileName);

			var xmlsettings = new XmlWriterSettings
			{
				Indent = true,
				IndentChars = "\t",
			};

			try
			{
				Dictionary<string, ColorGradient> gradients = _colorGradientLibrary.ToDictionary(gradient => gradient.Key, gradient => gradient.Value);

				DataContractSerializer ser = new DataContractSerializer(typeof(Dictionary<string, ColorGradient>));
				var writer = XmlWriter.Create(saveFileDialog.FileName, xmlsettings);
				ser.WriteObject(writer, gradients);
				writer.Close();
			}
			catch (Exception ex)
			{
				Logging.Error("While exporting Color Gradient Library: " + saveFileDialog.FileName + " " + ex.InnerException);
				//messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
				MessageBoxForm.msgIcon = SystemIcons.Warning; //this is used if you want to add a system icon to the message form.
				var messageBox = new MessageBoxForm("Unable to export data, please check the error log for details.", "Unable to export", false, false);
				messageBox.ShowDialog();
			}
		}
开发者ID:stewmc,项目名称:vixen,代码行数:36,代码来源:Form_ToolPalette.cs


注:本文中的MessageBoxForm.ShowDialog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。