listview或者其它控件 求问此图片可用winform里面的哪个控件实现?listview行不行?若是可用用listview,怎么设置listview是固定的行数和列数,并且显示行号和列号? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 看起来和datagridview能近似一些。listview的话,可以用第一列来显示行号和背景色,达到你的目的。listview里面有一个Columns属性,可以添加列,行需要你自己一条一条追加 DGV可以实现,listview也行下面就是dgv的效果(其实你可以自己控制样式): listView怎么显示列啊?我现在设置了显示模式是LargeIcon,如果要显示列,怎么设置? 可是datagridview在单元格中同时显示文字和图标,不是很麻烦吗? 其实都可以,不过datagridview对于你来说更好操控一些 我觉得那个带有图标和文字的项跟listview的largeIcon很像,datagridview也可以做成这样吗? 我用datagridview实现了,下面的函数中同时实现在单元格中画图片和文字 private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) { if (e.RowIndex<0 || e.ColumnIndex < 0)//标题栏不需要重新绘制 { return; } e.PaintBackground(e.CellBounds, true); e.Handled = true; e.Graphics.DrawImage(imageList1.Images[1], e.CellBounds.X + e.CellBounds.Width / 2 - imageList1.Images[1].Width / 2, e.CellBounds.Y + e.CellBounds.Height / 2 - imageList1.Images[1].Height / 2); TextRenderer.DrawText(e.Graphics, "hello my datagridview ", dataGridView1.DefaultCellStyle.Font, e.CellBounds, dataGridView1.DefaultCellStyle.ForeColor, TextFormatFlags.Bottom | TextFormatFlags.HorizontalCenter); } C#如何在指定位置读取文件 c#开发 基于wince的gps软件 C#应用中的集合算法,子集的比对 INSTALLSHIELD使用问题 用反射动态调用Web Service 真心求教? 讨论,C#能实现混音吗,即为一段录音配上背景音乐 C#中怎么删除treeview中自己选中的节点? C#写的网络程序服务端怎么开 如何用PC喇叭发声(嘀嘀警报),一定不能是音箱。 求帮助啊!关于网页格式和数据库的问题 无法连接邮件服务器是怎么回事?
listview的话,可以用第一列来显示行号和背景色,达到你的目的。listview里面有一个Columns属性,可以添加列,行需要你自己一条一条追加
下面就是dgv的效果(其实你可以自己控制样式):
listView怎么显示列啊?我现在设置了显示模式是LargeIcon,如果要显示列,怎么设置?
我觉得那个带有图标和文字的项跟listview的largeIcon很像,datagridview也可以做成这样吗?
private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
if (e.RowIndex<0 || e.ColumnIndex < 0)//标题栏不需要重新绘制
{
return;
}
e.PaintBackground(e.CellBounds, true);
e.Handled = true;
e.Graphics.DrawImage(imageList1.Images[1], e.CellBounds.X + e.CellBounds.Width / 2 - imageList1.Images[1].Width / 2, e.CellBounds.Y + e.CellBounds.Height / 2 - imageList1.Images[1].Height / 2);
TextRenderer.DrawText(e.Graphics, "hello my datagridview ", dataGridView1.DefaultCellStyle.Font,
e.CellBounds, dataGridView1.DefaultCellStyle.ForeColor, TextFormatFlags.Bottom | TextFormatFlags.HorizontalCenter);
}