Autor Beitrag
JeanvanHees
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 146

win 2000
D6 Pers
BeitragVerfasst: Do 06.05.04 07:48 
:wave: Hallo, erstmal

Ich hab also ein problem mit die lbOwnerDrawFixed style.
Wenn Ich ein Listbox diese style zuweise (was ich also benötige um in ondraw farbe zu ändern) hab ich ein problem wenn das programm 'gerunt' wird.
Wenn mann dan ein item anclickt wird da eine art box umher gezogen....aber wenn mann dan ein anderes item selectiert bleibt eine spuhr von den box um das alte item stehen. :roll:

Ist also ein estetischesch problem...Ist dies ein Delphi-bug (brauch ich also ein patch oder so), oder mach ich etwas falsch?

Naja...Ich hoffe das ihr mir mein immer schlechter werdendes Deutsch vergibt :wink: ...und mich helfen könnt.

_________________
Cause even though I know things won't get any better, they can certainly never get much worse!
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Do 06.05.04 08:53 
Hallo,

poste einmal den Code Deiner OnDraw. Mir sind gerade mein Glaskugeln ausgegangen :wink:

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
JeanvanHees Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 146

win 2000
D6 Pers
BeitragVerfasst: Do 06.05.04 08:57 
Es sind eigentlich mehrehre listboxes...und bei alle hab ich das problem bei ownerdrawfixed...Ich mach auch bei alle ungefähr dasselbe in die ondraw...


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TMain.ListBox17DrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
begin
if (FamilyID = $12)
        then begin
        ListBox17.Canvas.Font.Color := VHR_LISTBOX_COLOR[Index];
        if strtoint(ListBox17.Items.Strings[Index]) > 400
                then ListBox17.Canvas.Font.Color := clGray;
        ListBox17.Canvas.TextOut(Rect.Left + 2, Rect.Top, ListBox17.Items.Strings[Index]);
        end;
end;

_________________
Cause even though I know things won't get any better, they can certainly never get much worse!
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Do 06.05.04 09:00 
Hallo,

statt
ausblenden Delphi-Quelltext
1:
ListBox17.Canvas.TextOut(Rect.Left + 2, Rect.Top, ListBox17.Items.Strings[Index]);					

sollte folgendes funktionieren:
ausblenden Delphi-Quelltext
1:
ListBox17.Canvas.TextRect(Rect, Rect.Left + 2, Rect.Top, ListBox17.Items.Strings[Index]);					

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
JeanvanHees Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 146

win 2000
D6 Pers
BeitragVerfasst: Do 06.05.04 09:10 
Toll... hat fuctioniert so! :dance2:

Danke Smiegel! (very precious :P )

_________________
Cause even though I know things won't get any better, they can certainly never get much worse!