![]() |
Abkürzungstasten geht net
Hat jemand mal ne ahnung wie ich es anstellen kann das ich mit hilfe von Abkürzungen, den String "aa" oder "AA" in einer Zelle eines StringGrids einfüghen lassen kann
Delphi-Quellcode:
procedure TForm7.StringGrid1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState); var Celltext :string; n ,ACol, ARow :integer; begin with (Sender as TStringGrid) do begin Celltext:= Cells[ACol, ARow]; if ((Shift =[ssCtrl]) and (Key = VK_F8)) then if (Cells[ACol,ARow] = 'aa') or (Cells[ACol,ARow] = 'AA')then begin Canvas.Brush.Color:= ClGreen; //Zellenfarbe Canvas.Font.Color:= ClWhite; //Schriftfarbe Canvas.Font.Style:= Canvas.Font.Style + [fsBold]; //Text fett end; MESSAGEbeep(0) end; end; |
Re: Abkürzungstasten geht net
Du greifst auf Cells[ACol,ARow] zu, ohne diese vorher zu initialisieren...
|
Re: Abkürzungstasten geht net
muss man das überhaupt hohl mir doch aus dem StringGrid oder :gruebel:
|
Re: Abkürzungstasten geht net
Zeile 9:
Delphi-Quellcode:
Woher soll das StringGrid wissen, welche ACol und ARow Du meinst? ;-) Du musst dem Zeugs schon Werte zuweisen.
Celltext:= Cells[ACol, ARow];
|
Re: Abkürzungstasten geht net
hah Also geht das garnicht so einfach wie ich gedacht habe, ich muss also vorher noch abfragen welche Zelle makiert ist ???
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:32 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