掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
グリッドセルの配列宣言 (ID:7593)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
できますよ。見かけ上は。 フォームのプロパティーにするとよいです。 type TForm1 = class(TForm) StringGrid1: TStringGrid; Button1: TButton; Label1: TLabel; procedure Button1Click(Sender: TObject); private function GetCells(ACol, ARow: Integer): string; procedure SetCells(ACol, ARow: Integer; const Value: string); public property S[ACol, ARow: Integer]: string read GetCells write SetCells; end; var Form1: TForm1; implementation {$R *.DFM} function TForm1.GetCells(ACol, ARow: Integer): string; begin result := StringGrid1.Cells[ACol,ARow]; end; procedure TForm1.SetCells(ACol, ARow: Integer; const Value: string); begin StringGrid1.Cells[ACol,ARow] := Value; end; procedure TForm1.Button1Click(Sender: TObject); begin S[3,3] := 'TEST'; Label1.Caption := S[3,3]; end;
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.