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

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 27.04.05 15:17 
Prozedur, Funktion, Codeabschnitt, ... :-)

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mi 27.04.05 15:18 
user profile iconMarco15 hat folgendes geschrieben:
Sorry, aber was ist die Routine???

Einfach nur der Code, wo du neue Items in deine ListBox einfügst. ;)
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 27.04.05 15:18 
Du musst irgendeine Verbindung zwischen den Tds und dem entsprechenden Listbox Eintrag herstellen?

Wie füllst du denn die Listbox mit Inhalt?
Marco15 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98

Win XP Prof.
D2 Schüleredition, D7
BeitragVerfasst: Mi 27.04.05 15:18 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure show_box(x:Tbox);
var i : integer;
begin
  for i := 1 to max do // Wiederholschleife
    begin
      if x[i].nachname <> '' then
        begin
          form1.listbox1.items.add(
              x[i].vorname+' '+x[i].nachname+', '+
            x[i].tel);
        end;
    end;
end;


Meinst du das???

Moderiert von user profile iconTino: Delphi-Tags hinzugefügt.

_________________
Ich bin nur Schüler.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 27.04.05 15:20 
Okay, gehen wir davon aus, dass die Reihenfolge der Elemente in der Listbox synchron mit der Reihenfolge im Array ist. Dann ist es einfach:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure suche(x:Tbox);
var i: integer;
begin
  for i := 1 to max do
    begin
      if x[i].nachname = form1.Edit1.Text then
        form1.ListBox1.ItemIndex := i-1;
    end;
end;

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

Win XP Prof.
D2 Schüleredition, D7
BeitragVerfasst: Mi 27.04.05 15:24 
und wie bekomme ich es hin, dass er jetzt die leerzeichen nicht mitzählt?

_________________
Ich bin nur Schüler.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 27.04.05 15:25 
Leerzeichen? :gruebel:
Du solltest Dich wirklich mal so ausdrücken, dass man auch weiß, was Du meinst. :mahn:

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

Win XP Prof.
D2 Schüleredition, D7
BeitragVerfasst: Mi 27.04.05 15:30 
sorry, das war blödsinn.

ich habe drei editfelder
1.nachname
2. für vorname
3. für tele

Wenn ich jetzt den namen eingebe kommt in dem 3. editfeld ein kasten

_________________
Ich bin nur Schüler.
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 27.04.05 15:30 
Wie wäre es wenn du uns erstmal sagst, ob das mit dem Code von Christian geklappt hat. Nicht das wir die nächsten Probleme ganz wo anders suchen als du.
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 27.04.05 15:35 
user profile iconMarco15 hat folgendes geschrieben:
ich habe drei editfelder
Du hast doch weiter oben noch geschrieben das du nur ein Editfeld hast. Wo kommen denn plötzlich die anderen beiden her?
user profile iconMarco15 hat folgendes geschrieben:
Also, da ist ne listbox, ein editfeld und ein button.


Und was meinst du mit "Kasten"?
Marco15 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98

Win XP Prof.
D2 Schüleredition, D7
BeitragVerfasst: Mi 27.04.05 15:37 

so ein kasten.
die anderen editfelder spielen jetzt ja keine rolle.

_________________
Ich bin nur Schüler.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 27.04.05 15:39 
Sorry, ich steig hier aus. Aber bei den Beschreibungen kann man Dir einfach nicht helfen. Wenn Du etwas von uns willst, musst Du Dir schon ein wenig mehr Mühe bei Deinen Postings geben. :evil:

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 27.04.05 15:40 
Sorry, kann dir leider nicht weiter helfen.

Eventl. könnte ein Screenshot ja noch helfen zu verstehen was du mit Kasten meinst.


Zuletzt bearbeitet von Tino am Mi 27.04.05 15:41, insgesamt 1-mal bearbeitet
Marco15 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98

Win XP Prof.
D2 Schüleredition, D7
BeitragVerfasst: Mi 27.04.05 15:40 
hier:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure suche(x:Tbox);  
var i: integer;  
begin  
  for i := 1 to max do  
    begin  
      if x[i].nachname = form1.Edit1.Text then  
      form1.ListBox1.ItemIndex := i-1;  
    end;  
end;



passiert gar nichts.
der markiert das einfach nicht.

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt.

_________________
Ich bin nur Schüler.
Marco15 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98

Win XP Prof.
D2 Schüleredition, D7
BeitragVerfasst: Mi 27.04.05 15:48 
Sorry an alle hatte selber einen kleinen fehler eingebaut. tut mir leid.

Es geht jetzt aber.
Danke an alle, die mir versucht haben zu helfen.
Und für meine schlechte Ausdrucksweise entschuldige ich mich auch noch. :oops:

_________________
Ich bin nur Schüler.