同事拿了一只网路捉的 C# 程式叫我帮他改
public Form1()
{
InitializeComponent();
DataTable MyDataTable = new DataTable();
MyDataTable.Columns.Add("Index");
MyDataTable.Columns.Add("Column1");
for (int j = 0; j < 5; j++)
{
MyDataTable.Rows.Add(j,j.ToString());
}
this.dataGridView1.DataSource = MyDataTable;
this.dataGridView1.ReadOnly = true;
this.dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
}
private void dataGridView1_CellPainting_1(object sender, DataGridViewCellPaintingEventArgs e)
{
Rectangle Rectangle1 = this.dataGridView1.GetCellDisplayRectangle(0, 0, true);
Rectangle Rectangle2 = this.dataGridView1.GetCellDisplayRectangle(0, 1, true);
Rectangle Rectangle3 = this.dataGridView1.GetCellDisplayRectangle(0, 2, true);
Rectangle Rectangle4 = this.dataGridView1.GetCellDisplayRectangle(0, 3, true);
Rectangle ..
访客只能看到部份内容,免费 加入会员 或由脸书 Google 可以看到全部内容