DataGrid.GetCurrentCellBounds 方法

定義

取得指定選取儲存格四個角落的 Rectangle

public:
 System::Drawing::Rectangle GetCurrentCellBounds();
public System.Drawing.Rectangle GetCurrentCellBounds ();
member this.GetCurrentCellBounds : unit -> System.Drawing.Rectangle
Public Function GetCurrentCellBounds () As Rectangle

傳回

Rectangle,定義目前儲存格的四個端點。

範例

下列程式碼範例會取得 Rectangle 所選取儲存格的 。

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

適用於

另請參閱