> DEKOさん
開発はクラシック、動作確認Win7はテーマ未使用…
という環境でいつも使っているので、今まで全く知らずでした。(^^;
お陰さまで解決しました。
ありがとうございました。
-----------------------------------------------
// FormにComboBoxを貼り、
// ComboBox1のOnDrawItemにComboBox1DrawItemを割り当てる
type
TForm1 = class(TForm)
ComboBox1: TComboBox;
procedure FormCreate(Sender: TObject);
procedure ComboBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
private
{ Private 宣言 }
public
{ Public 宣言 }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
ComboBox1.Style :=csOwnerDrawFixed;
ComboBox1.Items.Add('あいうえお');
ComboBox1.Items.Add('かきくけこ');
ComboBox1.Items.Add('さしすせそ');
ComboBox1.ItemIndex:=0;
ComboBox1.TabStop :=false;
end;
procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
var
CB :TComboBox;
begin
CB :=Control as TComboBox;
with CB.Canvas do begin
FillRect(Rect);
Textout(4 ,Rect.Top+2,CB.Items[Index]);
//他にもここに書き込めばカスタマイズできる
end;
end;
end.
MLホームページ:
http://www.freeml.com/delphi-users