Autor Beitrag
Torsten
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 160



BeitragVerfasst: Fr 11.10.02 17:57 
Moinsen Leute!

Habe noch nicht wirklich viel mit TListBox gearbeitet.

Kann mir bitte jemand sagen, wie man einen ausgewählten Eintrag in einer ListBox wahlweise auf Groß- oder Kleinbuchstaben setzt?

Fragende Grüße

Torsten
patrick dee
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 311

Win 98SE, WinXP
D3,D6
BeitragVerfasst: Fr 11.10.02 18:06 
hi

meinst du so :
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var
  zeile : string;
  schleife : integer;
begin
  for Schleife := 0 to ListBox.Items.Count - 1 do
    begin
      Zeile := ListBox.Items[Schleife];

      // Alle Zeichen in Großbuchstaben verwandeln.
      Zeile := UpperCase(Zeile);

habe es nicht getestet. denke es sollte gehen.

gruß

patrick dee

(11.10.02 20:13 Tino) Code-Tags hinzugefügt.

_________________
Glauben heißt nichts wissen ...
Torsten Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 160



BeitragVerfasst: Fr 11.10.02 18:18 
Moinsen!

Danke für die Antwort.
So in etwa war auch meine Überlegung.

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
var     text: string;
begin
 if ListBox1.ItemIndex <> -1 then
  begin
        text:=UpperCase(ListBox1.Items[ListBox1.ItemIndex]);
        ListBox1.Items.Add(text);
  end;


Das funktioniert so schon ganz gut. Es wird jedoch ein neuer Eintrag zugefügt, also nicht der alte Eintrag umgewandelt und zurück geschrieben.

Doch irgendwie habe ich gerade einen Knoten im Hirn und komme nicht weiter.

Grüße

Torsten
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Fr 11.10.02 18:24 
Solche Knoten kenne ich ...

ausblenden Quelltext
1:
2:
if ListBox1.ItemIndex > -1 then
  ListBox1.Items[ListBox1.ItemIndex]:=UpperCase(ListBox1.Items[ListBox1.ItemIndex]);


MfG,
Peter

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Torsten Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 160



BeitragVerfasst: Fr 11.10.02 18:31 
Hallo Peter,

Du bist also Kenner im Gebiet Knoten. Wunderbar.
Du hast soeben einen doppelten Palsteg aufgelöst.
Besten Dank für die Hilfe, passt astrein.

Dankende Grüße

Torsten