国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

C#-MessageBox全部函數重載形式及舉例

2019-11-17 03:09:12
字體:
來源:轉載
供稿:網友
C#-MessageBox全部函數重載形式及舉例

Form1.cs

[csharp]view plaincopy在CODE上查看代碼片usingSystem;
  • usingSystem.Collections.Generic;
  • usingSystem.ComponentModel;
  • usingSystem.Data;
  • usingSystem.Drawing;
  • usingSystem.Linq;
  • usingSystem.Text;
  • usingSystem.Windows.Forms;
  • namespaceMessageBoxTest1
  • {
  • publicpartialclassForm1:Form
  • {
  • publicForm1()
  • {
  • InitializeComponent();
  • }
  • /*AboutMessageBox.Show()*/
  • //Show(String):消息框包含消息并返回結果
  • //Show(String,String)顯示消息和標題欄
  • //Show(Window,String)在指定的窗口前面顯示消息框,顯示消息并返回結果
  • //Show(String,String,BoxButton)消息,標題欄,按鈕,返回結果
  • //Show(Window,String,String)在指定窗口前面顯示消息框,消息,標題欄
  • //Show(String,String,MessageBoxButton,MessageBoxImage)消息,標題欄,按鈕,圖標
  • //Show(Window,String,String,MessageBoxButton)
  • //Show(String,String,MessageBoxButton,MessageBoxImage)
  • //Show(String,String,MessageBoxButton,MessageBoxImage,MessageBoxResult)
  • //Show(Window,String,String,MessageBoxButton,MessageImage)
  • //Show(String,String,MessageBoxButton,MessageBoxButton,MessageResult,MessageBoxOptions)遵循指定項返回結果
  • //Show(Window,String,String,
  • /*end*/
  • usingSystem;
  • usingSystem.Collections.Generic;
  • usingSystem.Linq;
  • usingSystem.Windows.Forms;
  • namespaceMessageBoxTest1
  • {
  • staticclassProgram
  • {
  • ///<summary>
  • ///應用程序的主入口點。
  • ///</summary>
  • [STAThread]
  • staticvoidMain()
  • {
  • application.EnableVisualStyles();
  • Application.SetCompatibleTextRenderingDefault(false);
  • Application.Run(newForm1());
  • }
  • }
  • }

    Form1設計

    [csharp]view%20plaincopy派生到我的代碼片
      1. namespaceMessageBoxTest1
      2. {
      3. partialclassForm1
      4. {
      5. ///<summary>
      6. ///必需的設計器變量。
      7. ///</summary>
      8. privateSystem.ComponentModel.IContainercomponents=null;
      9. ///<summary>
      10. ///清理所有正在使用的資源。
      11. ///</summary>
      12. ///<paramname="disposing">如果應釋放托管資源,為true;否則為false。</param>
      13. protectedoverridevoidDispose(booldisposing)
      14. {
      15. if(disposing&&(components!=null))
      16. {
      17. components.Dispose();
      18. }
      19. base.Dispose(disposing);
      20. }
      21. #regionWindows窗體設計器生成的代碼
      22. ///<summary>
      23. ///設計器支持所需的方法-不要
      24. ///使用代碼編輯器修改此方法的內容。
      25. ///</summary>
      26. privatevoidInitializeComponent()
      27. {
      28. this.button1=newSystem.Windows.Forms.Button();
      29. this.SuspendLayout();
      30. //
      31. //button1
      32. //
      33. this.button1.BackColor=System.Drawing.Color.Lime;
      34. this.button1.Location=newSystem.Drawing.Point(82,39);
      35. this.button1.Name="button1";
      36. this.button1.Size=newSystem.Drawing.Size(117,23);
      37. this.button1.TabIndex=1;
      38. this.button1.Text="開始測試";
      39. this.button1.UseVisualStyleBackColor=false;
      40. this.button1.Click+=newSystem.EventHandler(this.button1_Click);
      41. //
      42. //Form1
      43. //
      44. this.AutoScaleDimensions=newSystem.Drawing.SizeF(6F,12F);
      45. this.AutoScaleMode=System.Windows.Forms.AutoScaleMode.Font;
      46. this.BackColor=System.Drawing.Color.FromArgb(((int)(((byte)(255)))),((int)(((byte)(192)))),((int)(((byte)(192)))));
      47. this.ClientSize=newSystem.Drawing.Size(296,102);
      48. this.Controls.Add(this.button1);
      49. this.Name="Form1";
      50. this.Text="MessageBoxTest";
      51. this.ResumeLayout(false);
      52. }
      53. #endregion
      54. privateSystem.Windows.Forms.Buttonbutton1;
      55. }
      56. }

    發表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發表
    主站蜘蛛池模板: 封丘县| 乐都县| 孟连| 金湖县| 比如县| 阿图什市| 香港 | 利津县| 清河县| 通山县| 甘洛县| 奎屯市| 康马县| 米易县| 葫芦岛市| 新巴尔虎右旗| 尼木县| 盐边县| 南平市| 上犹县| 正镶白旗| 东丰县| 新兴县| 三河市| 林周县| 朔州市| 安溪县| 阿合奇县| 江孜县| 镇康县| 承德市| 广灵县| 吕梁市| 宾阳县| 射阳县| 纳雍县| 顺平县| 当阳市| 长宁县| 双柏县| 黄龙县|