同事拿了一隻網路捉的 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 可以看到全部內容