Autor Beitrag
raphael.23
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Do 13.04.06 13:47 
Hallo!
Wie kann ich diese Prozedur:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure save(squadnumber:integer;truppfuehrer,truppmann1:string);
var ini:tinifile;
begin
ini:=tinifile.create(extractfilepath(paramstr(0))+'squads.ini');
ini.writestring('squad_'+inttostr(squadnumber),'Truppführer',truppfuehrer);
ini.writestring('squad_'+inttostr(squadnumber),'Truppmann1',truppmann1);
ini.free;
end;

diesem Button:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
     button_save:=tbutton.create(newsquad);
     with button_save do
          begin
          parent:=newsquad;
          setbounds(700,400,80,40);
          caption:='Speichern';
          end;

als OnClick- Ereignis auf diesem Formular:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
newsquad:=tform.Create(application);
with newsquad do
     begin
     SetBounds(50,50,800,500);
     Color:=clblue;
     Caption:='Angriffstrupp '+inttostr(squadnumber);
     visible:=true;
     end;

zuweisen?
Vielen Dank im Voraus....
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 17.04.06 23:27 
Moin!

Mach dich mal ein bischen "schlau": Suche in: Delphi-Forum, Delphi-Library BUTTON DYNAMISCH

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Di 18.04.06 08:22 
user profile iconNarses hat folgendes geschrieben:
Moin!

Mach dich mal ein bischen "schlau": Suche in: Delphi-Forum, Delphi-Library BUTTON DYNAMISCH

cu
Narses


@narses: joooo!
@rafael.23: die Suche benutzen, die Frage gibt es nur wöchentlich einmal (höchstens) :wink:

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
Simon Joker
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 236
Erhaltene Danke: 1



BeitragVerfasst: Di 18.04.06 09:43 
Um die Antwort einfach zu halten: ÜBERHAUPT NICHT!


Grund ->
ausblenden Delphi-Quelltext
1:
procedure save(squadnumber:integer;truppfuehrer,truppmann1:string);					

ist eine Procedure und wird mit einem einfachen Pointer referenziert. Sie ist unter keinen Umständen kompatibel mit einem Methoden-Zeiger wie den OnClick-Event
ausblenden Delphi-Quelltext
1:
2:
3:
type TNotifyEvent = procedure (Sender: TObject) of object;

property OnClick: TNotifyEvent;

der in zwei Pointern gespeichert (Zum Objekt & zur Methode) wird.

Du mußt die Save in eine Methode (!) vom Typ TNotifyEvent verpacken, dann kannst du suchen gehen.

MfG Simon
raphael.23 Threadstarter
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Sa 22.04.06 11:58 
Hi.
Ich hab das doch noch nee ganz gerafft.
Ich hab zwar ne Weile probiert und andere Threads gelesen, aber ich kriegs immer noch nee hin.
simon:
Du mußt die Save in eine Methode (!) vom Typ TNotifyEvent verpacken, dann kannst du suchen gehen.

Wie und wo muss ich das machen??