Autor Beitrag
jackie05
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 357



BeitragVerfasst: Fr 03.12.10 20:18 
Hallo,
wie kann ich eine TGauge Komponente in ein ListView SubItems zeichnen?

Ich hab schon viel versucht, leider weiss ich nicht wie ich diese richtig in TListView anzeigen lassen kann, beim Scrollen der TListView sollen die TGauge natürlich mit gescrollt werden.

Ich bedanke mich schonmal im Voraus.

MfG
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19314
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 03.12.10 20:45 
Müssen es denn echte TGauge-Komponenten sein? Wenn ja, musst du die immer neu positionieren.

Einfacher wäre es, wenn du einfach in den CustomDraw oder AdvancedCustomDraw Ereignissen selbst zeichnest was du zeichnen möchtest.
bummi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1248
Erhaltene Danke: 187

XP - Server 2008R2
D2 - Delphi XE
BeitragVerfasst: Fr 03.12.10 20:55 
Falls Du nicht selbst zeichnen möchtest, was ich Dir empfehlen würde:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
uses ....,CommCtrl;
//......
gauge1.Parent := ListView1;
//......



procedure TForm1.ListView1AdvancedCustomDrawItem(Sender: TCustomListView;
  Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage;
  var DefaultDraw: Boolean);
var
 r:Trect;
begin
  
  ListView_GetItemRect(Sender.Handle, Item.Index, r, LVIR_BOUNDS);
  if Item.Index=2 then gauge1.BoundsRect:= r;
end;

_________________
Das Problem liegt üblicherweise zwischen den Ohren H₂♂
DRY DRY KISS