1. 建立一个窗体
2. 放一个ComboBox和Listbox
3. 改变Component的Style为csOwnerDrawVariable和ListBox的Style为lbOwnerDrawVariable。
4. 声明5个TBitmap的全局变量
5. 覆盖Form的OnCreate.
6. 覆盖ComboBox的OnDraw.
7. 覆盖ComboBox的OnMeasureItem.
8. 释放资源在Form的OnClose.
unit Ownerdrw;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls;
type
TForm1 = class(TForm)
ComboBox1: TComboBox;
ListBox1: TListBox;
...[ 查看全文 ]