求问此图片可用winform里面的哪个控件实现?
listview行不行?若是可用用listview,怎么设置listview是固定的行数和列数,并且显示行号和列号?

解决方案 »

  1.   

    看起来和datagridview能近似一些。
    listview的话,可以用第一列来显示行号和背景色,达到你的目的。listview里面有一个Columns属性,可以添加列,行需要你自己一条一条追加
      

  2.   

    DGV可以实现,listview也行
    下面就是dgv的效果(其实你可以自己控制样式):
      

  3.   


    listView怎么显示列啊?我现在设置了显示模式是LargeIcon,如果要显示列,怎么设置?
      

  4.   

    可是datagridview在单元格中同时显示文字和图标,不是很麻烦吗?
      

  5.   

    其实都可以,不过datagridview对于你来说更好操控一些
      

  6.   


    我觉得那个带有图标和文字的项跟listview的largeIcon很像,datagridview也可以做成这样吗?
      

  7.   

    我用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);
          
            }