掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
フォルダからMP3ファイルを検索してListBox1に表示するには? (ID:8367)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
気になって色々やってみていますがOnDrawItemは使えないけど DrawItemをオーバーライドすることはできるようです。 これで >01 ***.mp3 >02 ***.mp3 >03 ***.mp3 のような表示も可能ではないでしょうか? unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, FileCtrl; type TFileListBoxEx = class(TFileListBox) private { Private 宣言 } public { Public 宣言 } procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); override; end; type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); private { Private 宣言 } FFileListBoxEx : TFileListBoxEx; public { Public 宣言 } end; var Form1: TForm1; implementation {$R *.DFM} { TFileListBoxEx } procedure TForm1.FormCreate(Sender: TObject); begin FFileListBoxEx := TFileListBoxEx.Create(Self); FFileListBoxEx.Parent := Self; FFileListBoxEx.Align := alClient; end; procedure TFileListBoxEx.DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); begin Canvas.TextOut(Rect.Left + 2, Rect.Top,Format('%2.2d ',[Index + 1]) + Items[Index]) end;
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.