掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
ListboxのOnDrawItemを呼び出すには? (ID:17536)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
例えば、ListBox1.Style を lbOwnerDrawFixed としておいて、 以下のようにすれば、1行目だけ色付きで表示されるようになります。 procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); begin if Index = 0 then begin ListBox1.Canvas.Font.Color := clRed; ListBox1.Canvas.Brush.Color := clYellow; ListBox1.Canvas.FillRect(Rect); ListBox1.Canvas.TextOut(2, 2, ListBox1.Items[Index]); end; end;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.