Autor Beitrag
Marco15
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98

Win XP Prof.
D2 Schüleredition, D7
BeitragVerfasst: Di 26.04.05 13:50 
Hey Leute!!!

Ich habe hinbekommen, dass ich mit einem Klick auf den Button 'Suchen' den Befehl gebe, dass die Listbox durchsucht und nach dem Inhalt, was im Editfeld steht, abgesucht wird und, wenn es gefunden wurde den Inhalt in drei Editfeldern geschrieben.

Ich habe nun das Problem, dass ich es per Button_klick nicht ändern kann, also den geänderten item überschreibt.

Weiß jemand wie das geht??? :?:


Moderiert von user profile iconTino: Topic aus Sonstiges verschoben am Mi 27.04.2005 um 10:49

_________________
Ich bin nur Schüler.
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: Di 26.04.05 13:52 
Du möchtest also ein bestimmtes Item in deiner ListBox überschreiben?

ausblenden Delphi-Quelltext
1:
ListBox1.Items[i] := 'Neuer Text';					


:gruebel:
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Di 26.04.05 13:53 
Mit
ausblenden Delphi-Quelltext
1:
indexof					

kannst du die Einträge durchsuchen
Marco15 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98

Win XP Prof.
D2 Schüleredition, D7
BeitragVerfasst: Di 26.04.05 13:54 
Ich möchte den gesuchten Item im editfeld anzeigen, ihn ändern und den alten item mit dem geänderten item überschreiben.

_________________
Ich bin nur Schüler.
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Di 26.04.05 13:56 
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: Di 26.04.05 13:56 
:arrow: www.delphi-forum.de/...40811&highlight=

Da ist auch ein Beispielprogramm von mir. ;)
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Di 26.04.05 13:58 
Und mit ListBox1.items.indexof(String); kannst du deine Listbox nach nem String durchsuchen, dann wird die Zeile im INtegerwerrt zurückgegen
Marco15 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98

Win XP Prof.
D2 Schüleredition, D7
BeitragVerfasst: Di 26.04.05 14:03 
Und wie geht das wenn er den item gefunden hat, dass er diesen dann im editfeld anzeigt und ich ihn ändern kann?

_________________
Ich bin nur Schüler.
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: Di 26.04.05 14:05 
Ist es zuviel verlangt, dass du dir mein Projekt ansiehst? :roll:
Marco15 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98

Win XP Prof.
D2 Schüleredition, D7
BeitragVerfasst: Di 26.04.05 14:09 
Ich find das ja ganz toll, aber das ist nicht was ich meine.
Da soll ein editfeld sein, indem ich meinen suchbegriff eingebe und er durchsucht die listbox, nach dem suchbegriff und wenn er ihn gefunden hat, soll er diesen item anzeigen im editfeld, so dass ich ihn ändern kann und über den alten item schreibe, also das der alte weg ist und der geänderte da steht.

_________________
Ich bin nur Schüler.
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: Di 26.04.05 14:15 
Das ist meines Wissens genau der Inhalt des Projekts. :roll:

Aber egal. Du setzt dir einen Button, zwei Edits und eine ListBox auf dein Formular. Beim ButtonClick schreibst du folgendes:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
begin
for i := 0 to ListBox1.Count-1 do if ListBox1.Items[i] = Edit1.Text then ListBox1.Items[i] := Edit2.Text;
end;


Dann startest du das Programm. In Edit1 tippst du den gesuchten Text ein; in Edit2 den, mit dem der gesuchte ersetzt werden soll. ;)
Marco15 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98

Win XP Prof.
D2 Schüleredition, D7
BeitragVerfasst: Di 26.04.05 14:20 
Danke, ich werde es mal probieren.

_________________
Ich bin nur Schüler.
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: Di 26.04.05 14:27 
user profile iconMarco15 hat folgendes geschrieben:
Danke, ich werde es mal probieren.

Wie? :gruebel: Sitzt du grad nicht zuhause vor deinem PC? Dann versteh' ich auch, warum du dir das Projekt nicht angesehen hast... :roll:
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Di 26.04.05 15:49 
[OT] Er hat wahrschienlich gerade eine telepatische Verbindung zum DF Server aufgebaut :wink: [/OT]