DataGrid.GetCurrentCellBounds 方法
定义
public:
System::Drawing::Rectangle GetCurrentCellBounds();
public System.Drawing.Rectangle GetCurrentCellBounds ();
member this.GetCurrentCellBounds : unit -> System.Drawing.Rectangle
Public Function GetCurrentCellBounds () As Rectangle
返回
一个 Rectangle,它定义当前单元格的角。A Rectangle that defines the current cell's corners.
示例
下面的代码示例获取 Rectangle 选定单元格的。The following code example gets the Rectangle of the selected cell.
private:
void dataGrid1_CurrentCellChange( Object^ /*sender*/, EventArgs^ /*e*/ )
{
Rectangle rect;
rect = dataGrid1->GetCurrentCellBounds();
Console::WriteLine( rect );
}
private void dataGrid1_CurrentCellChange(object sender, EventArgs e)
{
Rectangle rect;
rect = dataGrid1.GetCurrentCellBounds();
Console.WriteLine(rect.ToString());
}
Private Sub DataGrid1_CurrentCellChange(ByVal sender As Object, ByVal e As EventArgs)
Dim rect As Rectangle
rect = DataGrid1.GetCurrentCellBounds()
Console.WriteLine(rect.ToString)
End Sub
注解
若要检索当前单元格以外的单元格边界,请使用 GetCellBounds 。To retrieve the cell bounds for a cell other than the current cell, use GetCellBounds.