DataGrid.GetCurrentCellBounds Metodo

Definizione

Ottiene un oggetto Rectangle che specifica i quattro angoli della cella selezionata.

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

Restituisce

Oggetto Rectangle che definisce gli angoli della cella corrente.

Esempio

L'esempio di codice seguente ottiene l'oggetto Rectangle della cella selezionata.

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

Commenti

Per recuperare i limiti di cella per una cella diversa dalla cella corrente, usare GetCellBounds.

Si applica a

Vedi anche