Autor Beitrag
LexXis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 170
Erhaltene Danke: 3



BeitragVerfasst: Do 31.07.08 17:05 
Hallo alle miteinander!

Habe momentag folgenden Quellcode (Neues Projekt, eine ListBox mit ein paar Einträgen drauf und Events eingetragen):
ausblenden volle Höhe Delphi-Quelltext
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
    { Private declarations }
  public
    { Public declarations }
  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
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: So 03.08.08 08:12 
Hallo,

das is schon richtig so.
wann/wo fügst du die Items hinzu? nur im OI, dann gehts nicht, füge die mal per code hinzu, dann wird das avent auch ausgelöst.

Gruß Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
LexXis Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 170
Erhaltene Danke: 3



BeitragVerfasst: So 03.08.08 11:16 
Alles klar, das war´s :D
Hatte vorher, wie von dir schon vermutet, die Items nur im OI eingetragen.