如何获得datagridview单元格中心的坐标
如何获得datagridview单元格中心的坐标
以便绘制线条,把这些标记了0的单元格,从上到下,依次连接起来
谢谢
[解决办法]
DataGridViewCell cell = dgv[0, 0];Rectangle rect = cell.ContentBounds;
[解决办法]
监听 CellPainting 事件 在事件处理程序中绘制线条
[解决办法]
private void dataGridView1_CellPainting(object sender, system.Windows.Forms.DataGridViewCellPaintingEventArgs e){ //e.CellBounds为单元格的区域,找到对应中心就很容易 //把值绘制在单元格中 e.Value e.Handled=true; //不能漏了这句}
[解决办法]