![]() |
ScrollBox mit permanenter vertikaler Scrollbar
Hallo,
das Thema ist wohl so alt wie Delphi selbst ... Der unten stehende Code funktioniert, solange die Scrollbar nicht dynamisch erzeugt wird. Packe ich den FormCreate-Code mit ins FormActivate (oder FormShow), klappt es nicht. Das liegt wohl daran, dass das eigentliche Window-Handle dann schon erzeugt ist. Was kann ich tun? PS: Eine abgeleitete Klasse will ich nicht verwenden.
Delphi-Quellcode:
procedure TForm115.FormActivate(Sender: TObject);
begin ShowScrollBar(ScrollBox1.Handle, SB_VERT, True); ShowScrollBar(ScrollBox1.Handle, SB_HORZ, False); end; procedure TForm115.FormCreate(Sender: TObject); var iStyle: Integer; begin iStyle:=GetWindowLong(ScrollBox1.Handle,GWL_STYLE); SetWindowLong(ScrollBox1.Handle,GWL_STYLE,iStyle or WS_HSCROLL or WS_VSCROLL); ScrollBox1.VertScrollBar.Visible := True; ScrollBox1.HorzScrollBar.Visible := True; ScrollBox1.AutoScroll := True; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:36 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