Autor Beitrag
Kaspar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 42



BeitragVerfasst: Mo 30.01.06 21:03 
Hallo zusammen

Eine kleine Frage, ist es möglich von einem Frame aus ein selbst erstellte Procedure aufzurufen, welche sich im Hauptformular befindet?
Also ich habe ein Form1 mit nem Frame1 in dem Form ist zb folgender code:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TEST();
begin
  Showmessage('tessssst');
end;


Wie kann ich diese nun vom Frame1 aus aufrufen?

Gruss

Kaspar

Moderiert von user profile iconGausi: Beitragsformatierung überarbeitet.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 30.01.06 21:16 
Andere Frage: Warum schreibst du hinter procedure Test zwei Klammern?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Kaspar Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 42



BeitragVerfasst: Mo 30.01.06 21:38 
Na wegen der Parameter, aber da ich keine übergeben will sind sie halt leer.
Wenn ich die weglasse, kommt n fehler.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 30.01.06 21:47 
user profile iconKaspar hat folgendes geschrieben:
Na wegen der Parameter, aber da ich keine übergeben will sind sie halt leer.
Wenn ich die weglasse, kommt n fehler.


Glaub ich dir beim besten Willen nicht :wink:

*ausprobier*

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TEST;
begin
  Showmessage('tessssst');
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
Test;

end;

end.


Bei mir meckert er net rum...

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Kaspar Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 42



BeitragVerfasst: Mo 30.01.06 23:15 
Okay, danke für den Tipp, doch leider hilft mir das nicht weiter..
Weiss niemand wie man das machen kann?
hibbert
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Mo 30.01.06 23:51 
probier es doch mit einer "globalen" procedure:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
 private
    { Private-Deklarationen }
  public
procedure test;
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.TEST;
begin
  Showmessage('tessssst');
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
Test;

end;


damit kannst du die procedur sicher aus deinem frame aufrufen.

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej
Kaspar Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 42



BeitragVerfasst: Di 31.01.06 23:45 
Hallo,

Vielen Dank! Hat super funktioniert.
Danke!

Gruss Kaspar