UCPosit.cs
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace UserCtrlsByDXC
{
public partial class UCPosit : UserControl
{
public UCPosit()
{
InitializeComponent();
}
private int listNo = 0;
public int ListNo
{
get { return listNo; }
set
{
listNo = value;
flowLayoutPanel1.Controls.Clear();
//this.Size = new Size(15 * listNo, 25);
for (int i = 0; i < listNo; i++)
{
Button bt = new Button();
bt.FlatStyle = FlatStyle.Popup;
//bt.Image = Properties.Resources.List;
bt.BackColor = Color.MediumTurquoise;
bt.Size = new Size(29, 24);
//bt.Location = new Point(15 * i, 0);
bt.ForeColor = Color.Blue;
bt.Font=new Font("Airal", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
bt.Text = (i + 1).ToString();
bt.Margin = new Padding(0);
//bt.Enabled = false;
flowLayoutPanel1.Controls.Add(bt);
}
}
}
}
}