![]() |
Trackbar: Größe von Slider und Channel getrennt einstellen?
Ich suche nach einer Möglichkeit, bei TTrackbar-Objekten die Größe von Slider und Channel unabhängig voneinander einzustellen. Wenn ich Property Thumblength benutze, wird gleichzeitig die Channel-Breite angepasst. Ich möchte aber den Slider vergrößern und den Channel schmal halten.
Danke für eine Antwort. |
Re: Trackbar: Größe von Slider und Channel getrennt einstell
Ich möchte meine Frage nochmal nach oben holen. Vielleicht kann ja doch jemand was dazu sagen.
Danke, Bertram |
Re: Trackbar: Größe von Slider und Channel getrennt einstell
Zitat:
falls du bereit bist, auch WIN32-Code anstelle reiner VCL zu akzeptieren - das Folgende ist ein Code-Schnipsel, das eine Progressbar in die Statusbar der Form einpasst (und dabei natürlich Breite und Höhe anpasst).
Delphi-Quellcode:
Und bitte keine Belehrungen drüber dass das nicht ins Forum passt, ich wollte nur dem Fragesteller helfen und wem der Code nicht passt der darf ihn wegwerfen.
procedure TProcessGauge.connect (B : TProgressBar; L : TLabel);
begin PG := B; PGL := L; SB := nil; end; { call this from FormShow after create and connect } procedure TProcessGauge.IntoStatusBar (ParentSB : TStatusBar; PBPanel,LPanel : integer); var xe,ye : integer; PBRect : TRect; PBStyle : integer; begin if not Assigned (PG) then exit; if not Assigned (ParentSB) then exit; SB := ParentSB; SBPanel := PBPanel; SBText := LPanel; SB.Perform (SB_GETRECT,SBPanel,integer (@PBRect)); PG.Parent := SB; { Progressbar in Statusbar } PBStyle := GetWindowLong (PG.Handle,GWL_EXSTYLE); PBStyle := PBStyle and not WS_EX_STATICEDGE; SetWindowLong(PG.Handle,GWL_EXSTYLE,PBStyle); with PBRect do begin xe := GetSystemMetrics (SM_CXEDGE); ye := GetSystemMetrics (SM_CYEDGE); Left := Left + xe + 1; Top := Top + ye + 1; Right := Right - xe - 1; Bottom := Bottom - ye - 1; end; PG.BoundsRect := PBRect; PG.Visible := false; Application.ProcessMessages; { redraw statusbar } end; Gruss Reinhard |
Re: Trackbar: Größe von Slider und Channel getrennt einstell
Oh, vielen Dank, Reinhard. Ich war jetzt drei Tage unterwegs und werde es morgen ausprobieren.
Viele Grüße, Bertram |
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:56 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz