Hallo alle miteinander!
Habe momentag folgenden Quellcode (Neues Projekt, eine ListBox mit ein paar Einträgen drauf und Events eingetragen):
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41:
| unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
type TForm1 = class(TForm) ListBox1: TListBox; procedure ListBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); procedure ListBox1MeasureItem(Control: TWinControl; Index: Integer; var Height: Integer); private public end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); begin ShowMessage('draw'); end;
procedure TForm1.ListBox1MeasureItem(Control: TWinControl; Index: Integer; var Height: Integer); begin ShowMessage('meassure'); end;
end. |
Style ist in der ListBox im OI auf 'lbOwnerDrawVariable' gesetzt, trotzdem wird OnMeasureItem nicht aufgerufen.
OnDrawItem aber schon. Hab ich irgendwas wichtiges übersehen?
Danke, mfg