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


C# MessageBoxForm.Show方法代码示例

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


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

示例1: XmppCon_OnMessage

        public void XmppCon_OnMessage(object sender, CSS.IM.XMPP.protocol.client.Message msg)
        {
            if (InvokeRequired)
            {
                // Windows Forms are not Thread Safe, we need to invoke this :(
                // We're not in the UI thread, so we need to call BeginInvoke
                Invoke(new OnMessageDelegate(XmppCon_OnMessage), new object[] { sender, msg });
                return;
            }

            // Dont handle GroupChat Messages here, they have their own callbacks in the
            // GroupChat Form
            if (msg.Type == MessageType.groupchat)
            {
                //Debug.WriteLine("创建聊天室发送了消息:"+msg.Body);
                return;
            }
            if (msg.Type == MessageType.error)
            {
                //Handle errors here
                // we dont handle them in this example
                return;
            }
            //if (msg.Type == MessageType.normal)
            //{
            //    filename = msg.Body;
            //    Debug.WriteLine(msg.ToString());
            //    return;
            //}

            // check for xData Message

            if (msg.HasTag(typeof(Data)))//如果是文件
            {
                Element e = msg.SelectSingleElement(typeof(Data));
                Data xdata = e as Data;
                if (xdata.Type == XDataFormType.form)
                {
                    //frmXData fXData = new frmXData(xdata);
                    //fXData.Text = "xData Form from " + msg.From.ToString();
                    //fXData.Show();
                }
            }
            else if (msg.HasTag(typeof(CSS.IM.XMPP.protocol.extensions.ibb.Data)))
            {
                // ignore IBB messages
                return;
            }
            else
            {
                if (msg.Body != null)
                {
                    if (msg.GetTag("subject") == "notify")//xu
                    {
                        filename = msg.Body;
                        return;
                    }
                    if (msg.From.ToString() == msg.From.Server)
                    {
                        if (CSS.IM.UI.Util.Path.ReveiveSystemNotification)//是否接收服务器消息
                        {
                            if (CSS.IM.UI.Util.Path.SystemSwitch)
                                SoundPlayEx.MsgPlay(CSS.IM.UI.Util.Path.SystemPath);

                            MessageBoxForm sBox = new MessageBoxForm("系统通知", msg);
                            try
                            {
                                sBox.TopMost = true;
                                sBox.Show();
                            }
                            catch (Exception)
                            {

                            }

                            string sqlstr = "insert into MessageLog (Belong,MessageType,MessageLog,[DateNow]) values ({0},{1},{2},{3})";
                            sqlstr = String.Format(sqlstr,
                                "'" + XmppCon.MyJID.Bare.ToString() + "'",
                                "'0'",
                                "'" + msg.ToString() + "'",
                                 "'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "'");
                            CSS.IM.Library.Data.OleDb.ExSQL(sqlstr);
                        }
                    }
                    else
                    {
                        if (!Util.ChatForms.ContainsKey(msg.From.Bare))//查看聊天窗口是否已经打开了
                        {

                            //RosterNode rn = rosterControl.GetRosterItem(msg.From);
                            //string nick = msg.From.Bare;
                            //if (rn != null)
                            //    nick = rn.Text;
                            try
                            {
                                //string sqlstr = "insert into ChatMessageLog (Jid,[MessageLog],[DateNow])values ({0},{1},{2})";
                                //sqlstr = String.Format(sqlstr,
                                //    "'" + msg.From.Bare.ToString() + "'",
                                //    "'" + msg.ToString() + "'",
                                //     "'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "'");
//.........这里部分代码省略.........
开发者ID:songques,项目名称:CSSIM_Solution,代码行数:101,代码来源:QQMainForm.cs

示例2: DoPageSetup

		/// <summary>
		/// Display a <see cref="PageSetupDialog" /> to the user, allowing them to modify
		/// the print settings for this <see cref="ZedGraphControl" />.
		/// </summary>
		public void DoPageSetup()
		{
			PrintDocument pd = PrintDocument;

			// Add a try/catch pair since the users of the control can't catch this one
			try {
				if (pd != null) {
					//pd.PrintPage += new PrintPageEventHandler( GraphPrintPage );
					PageSetupDialog setupDlg = new PageSetupDialog();
					setupDlg.Document = pd;

					if (setupDlg.ShowDialog() == DialogResult.OK) {
						pd.PrinterSettings = setupDlg.PrinterSettings;
						pd.DefaultPageSettings = setupDlg.PageSettings;

						// BUG in PrintDocument!!!  Converts in/mm repeatedly
						// http://support.microsoft.com/?id=814355
						// from http://www.vbinfozine.com/tpagesetupdialog.shtml, by Palo Mraz
						//if ( System.Globalization.RegionInfo.CurrentRegion.IsMetric )
						//{
						//	setupDlg.Document.DefaultPageSettings.Margins = PrinterUnitConvert.Convert(
						//	setupDlg.Document.DefaultPageSettings.Margins,
						//	PrinterUnit.Display, PrinterUnit.TenthsOfAMillimeter );
						//}
					}
				}
			}

			catch (Exception exception) {
				//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(exception.Message, "", false, false);
				messageBox.Show();
			}
		}
开发者ID:stewmc,项目名称:vixen,代码行数:39,代码来源:ZedGraphControl.Printing.cs

示例3: DoPrintPreview

		/// <summary>
		/// Display a <see cref="PrintPreviewDialog" />, allowing the user to preview and
		/// subsequently print the <see cref="MasterPane" /> contained in this
		/// <see cref="ZedGraphControl" />.
		/// </summary>
		public void DoPrintPreview()
		{
			// Add a try/catch pair since the users of the control can't catch this one
			try {
				PrintDocument pd = PrintDocument;

				if (pd != null) {
					PrintPreviewDialog ppd = new PrintPreviewDialog();
					//pd.PrintPage += new PrintPageEventHandler( Graph_PrintPage );
					ppd.Document = pd;
					ppd.Show(this);
				}
			}
			catch (Exception exception) {
				//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(exception.Message, "", false, false);
				messageBox.Show();
			}
		}
开发者ID:stewmc,项目名称:vixen,代码行数:25,代码来源:ZedGraphControl.Printing.cs

示例4: CopyEmf

		/// <summary>
		/// Special handler that copies the current image to an Emf file on the clipboard.
		/// </summary>
		/// <remarks>This version is similar to the regular <see cref="Copy" /> method, except that
		/// it will place an Emf image (vector) on the ClipBoard instead of the regular bitmap.</remarks>
		/// <param name="isShowMessage">boolean value that determines whether or not a prompt will be
		/// displayed.  true to show a message of "Image Copied to ClipBoard".</param>
		public void CopyEmf(bool isShowMessage)
		{
			if (_masterPane != null) {
				// Threaded copy mode to avoid crash with MTA
				// Contributed by Dave Moor
				Thread ct = new Thread(new ThreadStart(this.ClipboardCopyThreadEmf));
				//ct.ApartmentState = ApartmentState.STA;
				ct.SetApartmentState(ApartmentState.STA);
				ct.Start();
				ct.Join();

				if (isShowMessage) {
					string str = _resourceManager.GetString("copied_to_clip");
					//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(str, "", false, false);
					messageBox.Show();
				}
			}
		}
开发者ID:stewmc,项目名称:vixen,代码行数:27,代码来源:ZedGraphControl.ContextMenu.cs


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