![]() |
Stringgrid markiert
Ich habe sechs StringGrids auf meinem Formular. Wie kann ich nun ermitteln ob eines dieser Stringgrid markiert ist.
Folgenden Lösungsansatz habe ich gewählt.
Delphi-Quellcode:
Bin mir aber sicher das dieses einfacher geht. Doch finde ich im Moment keine andere Lösung. Gibt es noch eine weitere? Kann man vielleicht die Klasse vom aktuellen fokusierten Objekt heraus finden? Ich weiß zumindestens nicht wie man heraus bekommt welches Objekt zur Zeit den Fokus hat ...
var
iLoop: Integer; sgTemp: TStringGrid; begin //besitzt ein Stringgrid den Fokus sgTemp := nil; for iLoop := 0 to Panel1.ControlCount-1 do begin if( Panel1.Controls[ iLoop ] is TStringGrid ) then begin if( TStringGrid(Panel1.Controls[ iLoop ]).Focused ) then begin sgTemp := TStringGrid(Panel1.Controls[ iLoop ]); Break; end; end; end; if( sgTemp = nil ) then begin InfoMsg('Kein Grid ausgewählt!'); Exit; end; end; |
probiers mal mit ActiveControl
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:12 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz