DataGrid.GetCurrentCellBounds Metoda
Definicja
Ważny
Niektóre informacje dotyczą produktów przedpremierowych, które mogą zostać znacznie zmodyfikowane przed premierą. Microsoft nie udziela żadnych gwarancji, ani wyraźnych, ani domniemanych, dotyczących informacji podanych tutaj.
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.