Advertisement
Guest User

Untitled

a guest
May 16th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace _180510_c1
  12. {
  13. public partial class Form1 : Form
  14. {
  15. public String[] ButtonSign { get; private set; } = new String[] { "X", "?", "?" };
  16. public String[] BigButtonText { get; private set; } = new String[] { "Button", "RadioButton", "CheckBox" };
  17.  
  18. public Form1()
  19. {
  20. InitializeComponent();
  21. StartPosition = FormStartPosition.Manual;
  22. FormBorderStyle = FormBorderStyle.None;
  23. Location = new Point(0, 0);
  24. Size = new Size(320, 80);
  25. }
  26.  
  27. private void Form1_Load(object sender, EventArgs e)
  28. {
  29. CreateBasicInterface();
  30. }
  31.  
  32. private void CreateBasicInterface()
  33. {
  34. for (int i = 0; i < 3; i++)
  35. {
  36. GroupBox gb1 = new GroupBox()
  37. {
  38. Location = new Point(10 + i * 100, 10),
  39. Size = new Size(90, 60),
  40. Parent = this,
  41. Name = $"gp{i}",
  42. };
  43. Button btnBig = new Button()
  44. {
  45. Parent = gb1,
  46. Name = $"btnBig{i}",
  47. Text = BigButtonText[i],
  48. Location = new Point(0, 30),
  49. Size = new Size(90, 30)
  50. };
  51. btnBig.MouseUp += new MouseEventHandler(BigButton_MouseUp);
  52. for (int j = 0; j < 3; j++)
  53. {
  54. Button btn = new Button()
  55. {
  56. Parent = gb1,
  57. Name = $"btn{i}_{j}",
  58. Text = ButtonSign[j],
  59. Location = new Point(30 * j, 0),
  60. Size = new Size(30, 30),
  61. };
  62. switch (j)
  63. {
  64. case 0:
  65. btn.MouseUp += new MouseEventHandler(BtnX_MouseUp);
  66. break;
  67. case 1:
  68. btn.MouseUp += new MouseEventHandler(BtnUnhandled1_MouseUp);
  69. break;
  70. case 2:
  71. btn.MouseUp += new MouseEventHandler(BtnUnhandled122_MouseUp);
  72. break;
  73. }
  74. }
  75. }
  76. }
  77.  
  78. private void BtnUnhandled122_MouseUp(object sender, MouseEventArgs e)
  79. {
  80. throw new NotImplementedException();
  81. }
  82.  
  83. private void BigButton_MouseUp(object sender, MouseEventArgs e)
  84. {
  85.  
  86. }
  87.  
  88. private void BtnX_MouseUp(object sender, MouseEventArgs e)
  89. {
  90.  
  91. }
  92.  
  93. private void BtnUnhandled1_MouseUp(object sender, MouseEventArgs e)
  94. {
  95. throw new NotImplementedException();
  96. }
  97.  
  98. private void BtnUnhandled12_MouseUp(object sender, MouseEventArgs e)
  99. {
  100. throw new NotImplementedException();
  101. }
  102. }
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement