掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
StringGridで検索した文字列のフォーカスを維持するには? (ID:9713)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
こんな感じでいかがでしょうか? //〜onDrawCellイベントに〜 procedure THwdForm.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); begin if gdFocused in State then begin beforeFocusedCell.X:=ACol; // beforeFocusedCell:TPos (private) beforeFocusedCell.Y:=ARow; // end; if (beforeFocusedCell.X=ACol) and (beforeFocusedCell.Y=ARow) and (gdFocused in State = False ) and ((Sender as TStringGrid).Focused=False) then begin (Sender as TStringGrid).Canvas.Brush.Color:=(Sender as TStringGrid).Color; (Sender as TStringGrid).Canvas.FillRect(Rect); (Sender as TStringGrid).Canvas.DrawFocusRect(Rect); end; end; >選択とハイライトとフォーカスがぐちゃぐちゃになっていると思います。 確かに^^;
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.