掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
現在選択されている StringGrid のセル Low、Col を知るには (ID:36259)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
簡単な試しですが、以下でどうでしょうか?? 以前,ストレンジグリッドを使ったソフトを作った時、ストレンジグリッドで最初は自分も何ヶ月か悩みました^^; 環境はturbo Delphi2006(無償版)です。 ストレンジグリッドのSelectCellで、現在のセルの位置を取得できます。 var Form1: TForm1; row1,col1:integer; implementation {$R *.dfm} procedure TForm1.SpeedButton1Click(Sender: TObject); begin if sender = SpeedButton1 then StringGrid1.Cells[col1,row1] := '1'; if sender = SpeedButton2 then StringGrid1.Cells[col1,row1] := '2'; if sender = SpeedButton3 then StringGrid1.Cells[col1,row1] := '3'; if sender = SpeedButton4 then StringGrid1.Cells[col1,row1] := '4'; if sender = SpeedButton5 then StringGrid1.Cells[col1,row1] := '5'; if sender = SpeedButton6 then StringGrid1.Cells[col1,row1] := '6'; if sender = SpeedButton7 then StringGrid1.Cells[col1,row1] := '7'; if sender = SpeedButton8 then StringGrid1.Cells[col1,row1] := '8'; if sender = SpeedButton9 then StringGrid1.Cells[col1,row1] := '9'; end; procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol, ARow: Integer; var CanSelect: Boolean); begin col1 := ACol; row1 := ARow;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.