如何获得datagridview单元格中心的坐标 本帖最后由 zhenghq1001 于 2012-05-09 13:26:40 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 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; //不能漏了这句} 不建议你在DataGridView里做这些东西,还是自绘控件来到方便。 如何去掉最后一个字符 关于GDI+的问题(C#),希望各路神仙指点... 在C#的MDI应用程序中,如何判断某个子窗口是否被激活 为什么在VS2005中COOKIES中文是乱码? 怎样得到monthCalendar选择的日期? 梅花日历如何实现? 请教---- 数据的绑订 如何用代码控制gridview控件字体的大小 请问怎样实现blog增减版块?(我是初学者,请多多帮助) 怎样将用户坐标转化为屏幕坐标。 苦逼的POS机开发 新手请教,抓取网页数据的问题
DataGridViewCell cell = dgv[0, 0];
Rectangle rect = cell.ContentBounds;
private void dataGridView1_CellPainting(object sender, system.Windows.Forms.DataGridViewCellPaintingEventArgs e)
{
//e.CellBounds为单元格的区域,找到对应中心就很容易
//把值绘制在单元格中 e.Value
e.Handled=true; //不能漏了这句
}