掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
stringgridで、プログラム側から、点灯してるセルの位置を変更するには (ID:35680)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
igyさんありがとうございます、コード無しですいません^^; 悩んでいる部分は以下です。 省略多数ですが、以下の感じです。 「次項」ボタンを押しても、 StringGrid1DrawCellは実行されないみたいです。 何かよい方法は無いでしょうか?? var y1:integer=1; x1:integer=1; procedure TForm1.Button4Click(Sender: TObject); begin{次項ボタン} //次項移動処理…(省略 StringGrid1.RowCount := StringGrid1.RowCount + 1; x1 := StringGrid1.Col; y1 := StringGrid1.Row; end; procedure TForm1.StringGrid1DrawCell(Sender: TObject; Col, Row: Integer; Rect: TRect; State: TGridDrawState); begin if (col = x1) and (row = y1) then begin StringGrid1.canvas.Brush.Color := clWhite; StringGrid1.Canvas.FillRect(rect); StringGrid1.Canvas.Font.Color := clBlack; drawtext(StringGrid1.canvas.Handle, PChar(StringGrid1.cells[col,row]), Length(StringGrid1.cells[col,row]), rect,DT_LEFT); end;
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.