如图所示的主键小图标?

解决方案 »

  1.   

    我从SQL SERVER 里抓的图,我是指,自己设计WINFORM时,使用DATAGRIDVIEW如何实现这样的效果?
      

  2.   

      private void dataGridView1_Paint(object sender, PaintEventArgs e)
            {
                DataGridView _View = (DataGridView)sender;
                if (_View.Columns.Count == 0 || _View.RowCount == 0) return;            Rectangle _ColRectangle = dataGridView1.GetCellDisplayRectangle(0, 0, true);            e.Graphics.DrawIcon(this.Icon, new Rectangle(0, _ColRectangle.Y, _ColRectangle.X, _ColRectangle.Height));
            }
    看看这样 能达到要求不
      

  3.   

    晕~~有点花..改下        DataGridView _View = (DataGridView)sender;
                if (_View.Columns.Count == 0 || _View.RowCount == 0) return;            Rectangle _ColRectangle = dataGridView1.GetCellDisplayRectangle(0, 0, true);
                if (_ColRectangle.X == 0 || _ColRectangle.Y == 0) return;
                e.Graphics.DrawIcon(this.Icon, new Rectangle(0, _ColRectangle.Y, _ColRectangle.X, _ColRectangle.Height));