Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace _180510_c1
- {
- public partial class Form1 : Form
- {
- public String[] ButtonSign { get; private set; } = new String[] { "X", "?", "?" };
- public String[] BigButtonText { get; private set; } = new String[] { "Button", "RadioButton", "CheckBox" };
- public Form1()
- {
- InitializeComponent();
- StartPosition = FormStartPosition.Manual;
- FormBorderStyle = FormBorderStyle.None;
- Location = new Point(0, 0);
- Size = new Size(320, 80);
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- CreateBasicInterface();
- }
- private void CreateBasicInterface()
- {
- for (int i = 0; i < 3; i++)
- {
- GroupBox gb1 = new GroupBox()
- {
- Location = new Point(10 + i * 100, 10),
- Size = new Size(90, 60),
- Parent = this,
- Name = $"gp{i}",
- };
- Button btnBig = new Button()
- {
- Parent = gb1,
- Name = $"btnBig{i}",
- Text = BigButtonText[i],
- Location = new Point(0, 30),
- Size = new Size(90, 30)
- };
- btnBig.MouseUp += new MouseEventHandler(BigButton_MouseUp);
- for (int j = 0; j < 3; j++)
- {
- Button btn = new Button()
- {
- Parent = gb1,
- Name = $"btn{i}_{j}",
- Text = ButtonSign[j],
- Location = new Point(30 * j, 0),
- Size = new Size(30, 30),
- };
- switch (j)
- {
- case 0:
- btn.MouseUp += new MouseEventHandler(BtnX_MouseUp);
- break;
- case 1:
- btn.MouseUp += new MouseEventHandler(BtnUnhandled1_MouseUp);
- break;
- case 2:
- btn.MouseUp += new MouseEventHandler(BtnUnhandled122_MouseUp);
- break;
- }
- }
- }
- }
- private void BtnUnhandled122_MouseUp(object sender, MouseEventArgs e)
- {
- throw new NotImplementedException();
- }
- private void BigButton_MouseUp(object sender, MouseEventArgs e)
- {
- }
- private void BtnX_MouseUp(object sender, MouseEventArgs e)
- {
- }
- private void BtnUnhandled1_MouseUp(object sender, MouseEventArgs e)
- {
- throw new NotImplementedException();
- }
- private void BtnUnhandled12_MouseUp(object sender, MouseEventArgs e)
- {
- throw new NotImplementedException();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement