Autor Beitrag
teamrocket0
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 177
Erhaltene Danke: 1

Win ME, Win XP, Win 7, Win 10
Delphi 7, 10.2 Tokyo
BeitragVerfasst: Sa 01.12.07 00:11 
Moinsen,

wie kann ich in einer Listbox 2 Scrollbars anzeigen, also eine für horizontal und eine für vertikal?

Für einen Hinweis wäre ich Dankbar.


Moderiert von user profile iconNarses: Topic aus Multimedia / Grafik verschoben am Sa 01.12.2007 um 00:12

_________________
To be forgotten is worse than death!
teamrocket0 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 177
Erhaltene Danke: 1

Win ME, Win XP, Win 7, Win 10
Delphi 7, 10.2 Tokyo
BeitragVerfasst: Sa 01.12.07 00:30 
OK Leute...danke für eure Mühe, aber hat sich...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.FormCreate(Sender: TObject);
begin
 Listbox1.Perform(LB_SetHorizontalExtent, 1000, Longint(0));
end;


Besten Dank... :wink:

_________________
To be forgotten is worse than death!
fuba
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 125

Win7
D7 Ent.
BeitragVerfasst: Sa 08.03.08 05:59 
am schönsten geht es, wen du im OnDrawItem folgendes einfügst:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
var
  Len: integer;
begin
  Len:=((Length(ListBox1.Items[Index]) *7) +5);
  if Len > ListBox1.ScrollWidth then ListBox1.ScrollWidth:=Len;
end;


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
type
 TForm1 = class(TForm)
//...
 private
   flbHorzScrollWidth: Integer;
//...

procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
var
  Len: integer;
begin
  Len:=((Length(ListBox1.Items[Index]) *7) +5);
  if Len > flbHorzScrollWidth then Listbox1.Perform(LB_SETHORIZONTALEXTENT, flbHorzScrollWidth, 0 );
end;


Damit sollte deine horizontale Scrollbar immer soweit gehen, dass der in deiner Listbox längster Text sichtbar ist.
teamrocket0 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 177
Erhaltene Danke: 1

Win ME, Win XP, Win 7, Win 10
Delphi 7, 10.2 Tokyo
BeitragVerfasst: Sa 08.03.08 21:36 
Huh...das ist natürlich auch nicht schlecht.

Danke für den Tipp. :D

_________________
To be forgotten is worse than death!