Autor Beitrag
Delphi7
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 41

Win XP Home Edition
Borland Delphi 7 Studio Enterprise
BeitragVerfasst: So 28.12.03 14:00 
Salam erst mal!!!

Ich brauche hilfe bei mein projekt und zwar folgendes:
ich habe eine ListBox, ein Edit feld und ein SpeedButton. wenn ich jetzt eine text aus der ListBox markiere, dann in Edit feld ein text rein schreibe und auf SpeedButton drücke, dann soll der markierter ListBox text genauso wie der text in Edit feld sein.

Z.B.:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TForm1.SpeedButton1Click(Sender: TObject);
if markiere ListBox text then
begin
ListBox1.Items.Text:=Edit1.Text;
end
else
begin
ShowMessage('erst text markieren!');
end:
end;


wie geht das? weiß einer vielleicht irgendeine lösung?
werde danlbar sein.

delphi...

Moderiert von user profile iconPeter Lustig: Delphi-Tags hinzugefügt
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 28.12.03 14:08 
Löschen und neuen Eintrag an der Stelle einfügen. eindirektes Editieren oder Umbenennen ist nicht möglich.
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: So 28.12.03 14:24 
Zitat:
eindirektes Editieren oder Umbenennen ist nicht
IMHO schon: probier´s mal mitListBox1.Items.Strings[0] := 'NEUER TEXT';

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
Delphi7 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 41

Win XP Home Edition
Borland Delphi 7 Studio Enterprise
BeitragVerfasst: So 28.12.03 17:19 
wie wärs mal wenn du meine frage richtig durchliest


hast mir auch so ganz gut geholfen
hibbert
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: So 28.12.03 17:29 
Probier es mal hiermit:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
var idx:integer;
begin
  idx:=listbox1.itemindex;
  listbox1.items[idx]:=edit1.text;
end;


MfG Hibbert

Moderiert von user profile iconPeter Lustig: Code- durch Delphi-Tags ersetzt

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: So 28.12.03 17:40 
@Delphi7
meinst du sowas:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
Listbox1.OnClick:
Edit1.Text:=ListBox1.Items[Listbox1.ItemIndex]

SpeedButton1.onClick:
ListBox1.Items[Listbox1.ItemIndex]:=Edit1.Text;

_________________
MFG
Michael Springwald, "kann kein englisch...."
hibbert
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: So 28.12.03 17:52 
@ mimi:
das ist das gleiche was ich geschrieben habe, nur das ich dazu eine Variable verwende (sch** Info unterricht).

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: So 28.12.03 18:00 
ein unterschied gibst es schon:
da werden zwei sachen ausgeführt: einmal bei onClick in der Listbox und einmal bei onClick bei dem SpeedButton *G*

zum glück hatte ich nie info in der schule(was auch schade ist, eigetnlich) *G*

_________________
MFG
Michael Springwald, "kann kein englisch...."
hibbert
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: So 28.12.03 18:04 
das mit dem klick auf die listbox ist ja nur son zusatz teil, was dem user die arbeit erleichtern soll, damit er nicht nochmal alles in das editfeld eingeben muss.

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: So 28.12.03 19:24 
Zitat:
wie wärs mal wenn du meine frage richtig durchliest
Was soll das?
Natürlich hätte ich auch
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure tform1.SpeedButton1OnClick(Sender: TObject);
begin
 ListBox1.Items.Strings[ListBox1.ItemIndex] := Edit1.text;
end;

schreiben können und du hättest es dann mit Copy & Paste eingefügt, wobei du sehr viel lernst und ein wahrer MeisterDelphiProgger wirst :evil:
Also habe ich dir nur einen Denkanstoß gegeben, da ich dachte wie man OnClick Events handhabt weißt du selbst (ganz zu schweigen von Zuweisungen). Außerdem hab ich mehr oder weniger auf Luckie´s Äußerung geantwortet.

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
Delphi7 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 41

Win XP Home Edition
Borland Delphi 7 Studio Enterprise
BeitragVerfasst: So 28.12.03 21:44 
ok ok ok. sorry.

vielen dank an alle!!!