Autor Beitrag
Chatfix
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1583
Erhaltene Danke: 10

Win 10, Win 8, Win 7, Win Vista, Win XP
VB.net (VS 2015), MsSQL (T-SQL), HTML, CSS, PHP, MySQL
BeitragVerfasst: Mo 24.06.02 12:21 
Hallo ich möchte in eine Listbox eine vertikale (von links nach recht :D ) Scrollbar reinhaben, die erscheint wen eine zeile über die breite der listbox rausgeht...

_________________
Gehirn: ein Organ, mit dem wir denken, daß wir denken. - Ambrose Bierce
mathias
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 58
Erhaltene Danke: 3



BeitragVerfasst: Mo 24.06.02 20:23 
ausblenden Quelltext
1:
2:
3:
4:
procedure TForm1.Button1Click(Sender: TObject);
begin             // 200 ist die Breite des ListBoxinhalt in Pixel
  SendMessage(Listbox1.Handle, LB_SetHorizontalExtent, 200, 0);
end;
oderListBox1.ScrollWidth := 200;:)
Chatfix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1583
Erhaltene Danke: 10

Win 10, Win 8, Win 7, Win Vista, Win XP
VB.net (VS 2015), MsSQL (T-SQL), HTML, CSS, PHP, MySQL
BeitragVerfasst: Mo 24.06.02 20:56 
Wie bekomme ich die Breite des ListBoxinhalt heraus? ist das die breite der listbox?

_________________
Gehirn: ein Organ, mit dem wir denken, daß wir denken. - Ambrose Bierce
Chatfix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1583
Erhaltene Danke: 10

Win 10, Win 8, Win 7, Win Vista, Win XP
VB.net (VS 2015), MsSQL (T-SQL), HTML, CSS, PHP, MySQL
BeitragVerfasst: Sa 29.06.02 00:38 
hat keiner eine idee ich bastel grad an einem code, aber es funzt noch ncih so ganz.. ich werde dann meine lösung mal posten, wäre aber nett falls es einer schon weiß

_________________
Gehirn: ein Organ, mit dem wir denken, daß wir denken. - Ambrose Bierce
TheUnknown
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 334



BeitragVerfasst: Sa 29.06.02 07:25 
...


Zuletzt bearbeitet von TheUnknown am Do 22.08.13 09:16, insgesamt 2-mal bearbeitet
mathias
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 58
Erhaltene Danke: 3



BeitragVerfasst: Sa 29.06.02 20:59 
Titel: Re: Hmmm, vielleicht so...!?
Man muss also jeden einzelen Eintrag durchtesten um zu schauen welcher am längsten ist. :(
Chatfix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1583
Erhaltene Danke: 10

Win 10, Win 8, Win 7, Win Vista, Win XP
VB.net (VS 2015), MsSQL (T-SQL), HTML, CSS, PHP, MySQL
BeitragVerfasst: So 30.06.02 00:44 
Titel: funzt nich :(
also meine funktion sieht jetzt so aus aber es kommt immer der gleiche 6 stellige wert raus, egal ob ich einen buchstabe eingebe oder zwi oder drei...

was habe ich falsch?

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
function lbbreite :integer;
var lbl : TLabel;
var cache,i:integer;
begin
if form1.ListBox1.items.Count <> 0 then
begin
  for i:=0 to form1.listbox1.items.Count-1 do
    begin
      lbl := TLabel.Create(Form1);
      lbl.Parent := Form1;
      lbl.Visible := False;
      lbl.AutoSize := True;
      lbl.Caption:='';
      lbl.Width:=0;
      lbl.Caption := form1.ListBox1.Items[i];
      if lbl.width > cache then
        cache := lbl.Width;
      lbl.Free;
    end;
  if cache < form1.listbox1.Width then cache:=0;
  result:=cache;
end
else
  result:=0;

showmessage(inttostr(result));
end;

_________________
Gehirn: ein Organ, mit dem wir denken, daß wir denken. - Ambrose Bierce
TheUnknown
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 334



BeitragVerfasst: So 30.06.02 10:22 
...


Zuletzt bearbeitet von TheUnknown am Do 22.08.13 09:16, insgesamt 2-mal bearbeitet
Chatfix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1583
Erhaltene Danke: 10

Win 10, Win 8, Win 7, Win Vista, Win XP
VB.net (VS 2015), MsSQL (T-SQL), HTML, CSS, PHP, MySQL
BeitragVerfasst: So 30.06.02 10:36 
Ja danke jetzt funzt es.. ist aber trotzdem komisch das bei meiner variante ein 6stelliger wert rauskommt.. mhhh naja egal...

_________________
Gehirn: ein Organ, mit dem wir denken, daß wir denken. - Ambrose Bierce