DataGrid.GetCurrentCellBounds Metoda

Definicja

Pobiera element Rectangle określający cztery rogi zaznaczonej komórki.

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

Zwraca

Element Rectangle definiujący narożniki bieżącej komórki.

Przykłady

Poniższy przykład kodu pobiera Rectangle zaznaczoną komórkę.

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

Uwagi

Aby pobrać granice komórek dla komórki innej niż bieżąca komórka, użyj polecenia GetCellBounds.

Dotyczy

Zobacz też