在WinForm中,怎样来设定每行的高度?怎样来选定mouse点击DataGrid列表头下的全部列(点击第2列时,即选中每行的第2列)

解决方案 »

  1.   

    在WinForm中,对DataGrid好像设置其属性比较难,希望有这方面经念的高手帮忙!
      

  2.   

    private void dgRules_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
    {
    System.Drawing.Point pt = new Point(e.X, e.Y); 
    DataGrid.HitTestInfo hti = dgRules.HitTest(pt); 
    if(hti.Type == DataGrid.HitTestType.Cell) 
    {
    dgRules.CurrentCell = new DataGridCell(hti.Row, hti.Column); 
    dgRules.Select(hti.Row); 

    }
      

  3.   

    wubin9(冰冰)的方法是选行而不是选列
    上午也看到一个类似的帖子,也没有解决,关注...
      

  4.   

    设置DataGrid字体的大小就可以改变每行的高度
      

  5.   

    private void dgRules_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
    {
    System.Drawing.Point pt = new Point(e.X, e.Y); 
    DataGrid.HitTestInfo hti = dgRules.HitTest(pt); 
    if(hti.Type == DataGrid.HitTestType.Cell) 
    {
    dgRules.CurrentCell = new DataGridCell(hti.Row, hti.Column); 
    dgRules.Select(hti.Row); 

    }
    private void dgRules_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
    {
    System.Drawing.Point pt = new Point(e.X, e.Y); 
    DataGrid.HitTestInfo hti = dgRules.HitTest(pt); 
    if(hti.Type == DataGrid.HitTestType.Cell) 
    {
    dgRules.CurrentCell = new DataGridCell(hti.Row, hti.Column); 
    dgRules.Select(hti.Row); 

    }