Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Combobox mit horizontaler Scrollbar (https://www.delphipraxis.net/112931-combobox-mit-horizontaler-scrollbar.html)

champagner 29. Apr 2008 20:01


Combobox mit horizontaler Scrollbar
 
Hallo,

ich habe eine Combobox. Der Item-text ist sehr breit, so dass eine horizontale Scrollbar benötigt wird.

Wie funktioniert das? :wall:


Danke!

toms 29. Apr 2008 20:13

Re: Combobox mit horizontaler Scrollbar
 
Hallo,

Das scheint ziemlich aufwändig zu sein. Siehe z.B hier (VB Code)

Wenn du nur die Breite der Dropdown Liste vergrössern möchtest, kannst du so vorgehen:
Sende der Combobox eine CB_SETDROPPEDWIDTH Nachricht und gibt die Breite in Pixeln an.

Delphi-Quellcode:
ComboBox1.Perform(CB_SETDROPPEDWIDTH, 300, 0);

himitsu 29. Apr 2008 20:44

Re: Combobox mit horizontaler Scrollbar
 
einfach mal so versucht
Delphi-Quellcode:
// falls WS_HSCROLL noch nicht gesetzt ist
SetWindowLong(ComboBox1.Handle, GWL_STYLE, GetWindowLong(ComboBox1.Handle, GWL_STYLE) or WS_HSCROLL);

ComboBox1.Perform(CB_SETHORIZONTALEXTENT, 300, 0);
geht hier aber nicht,

wobei dieses och nichts bring:
Delphi-Quellcode:
ComboBox1.Perform(CB_SETDROPPEDWIDTH, 300, 0);

toms 29. Apr 2008 20:51

Re: Combobox mit horizontaler Scrollbar
 
Zitat:

Zitat von himitsu
wobei dieses och nichts bring:
Delphi-Quellcode:
ComboBox1.Perform(CB_SETDROPPEDWIDTH, 300, 0);

Geht schon. Der Code muss nur an der richtigen Stelle aufgerufen werden.
Nämlich im OnDropDown


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:26 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz