110,566
社区成员
发帖
与我相关
我的任务
分享
Pen p1 = new Pen(Color.Yellow);
Pen p2 = new Pen(Color.Yellow);
//p1.Width = 1;
//p1.DashCap = DashCap.Triangle;
Graphics g = e.Graphics;
SolidBrush ff = new SolidBrush(Color.Yellow);
// g.FillRectangle(ff, 100, 150, 700, 350);
g.DrawRectangle(p1, 0, 0, 600, 600);
for (int i = 0; i <= 600;)
{
g.DrawLine(p2, new Point(i, 0), new Point(i, 600));
g.DrawLine(p2, new Point(0, i), new Point(600, i));
i = i + 20;
}
void Form1_MouseClick(object sender, MouseEventArgs e)
{
AddButton(e.X, e.Y);
}
private void AddButton(int x, int y)
{
Button b = new Button();
b.Width = 20;
b.Height = 20;
b.Location = new System.Drawing.Point((x / 20) * 20, ((y / 20)) * 20);
b.UseVisualStyleBackColor = true;
b.Click += new EventHandler(b_Click);
this.Controls.Add(b);
}
Point p;
string txt = string.Empty;
foreach (Control ctrl in this.Controls)
{
if (ctrl.GetType() == typeof(Button))
{
if (((Button)ctrl).Name != "save" && ((Button)ctrl).Name != "read" && ((Button)ctrl).Name != "sort")
{
p = ((Button)ctrl).Location;
txt += p.X / 20 + "|" + p.Y / 20 + "\r\n";
}
}
}
WriteFile(txt);
class 座位
{
}
class cls排座
{
List<List<座位>> 所有座位 = new List<List<座位>>();
//所有座位[0] 第1排所有座位
//所有座位[0][0] 第1排第1座
//所有座位[6][8] 第7排第9座
}