Autor Beitrag
-delphin-
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 200



BeitragVerfasst: Sa 18.06.05 11:20 
Also ich wüsste gerne, wie ich in meiner Unit2 die Prozedur zu einem Button mache, der sich in der Unit1, bzw auf dem Form1 befindet.
Mit TForm1.Button1Click gehts nich, leider...
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: Sa 18.06.05 11:24 
Moin... ;)

Erstmal musst du die entsprechende Unit unter uses dazuschreiben. Dann kannst du normalerweise die procedure mit
ausblenden Delphi-Quelltext
1:
Unit1.Button1Click					

aufrufen. ;)

Ist nicht getestet, hab grad kein Delphi zur Hand.
-delphin- Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 200



BeitragVerfasst: Sa 18.06.05 11:38 
das ist mein (vereinfachter) quelltext der unit2 auf der die prozedur BRechnenClick sein soll.. die wesentlichen teile sind aber komplett:

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:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
unit Unit2; //<- Name der zweiten Unit
interface

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

type
  TFHighscore = class(TForm)
    SGHighscore: TStringGrid;
    procedure FormCreate(Sender: TObject);
    procedure UKniffel.BRechnenClick(Sender: TObject); //BRechnen ein Button auf dem ersten Formular (FKniffel)
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  FHighscore: TFHighscore;

implementation

uses UKniffel; //<- hier ist die erste Unit definiert

{$R *.dfm}

procedure TFHighscore.FormCreate(Sender: TObject);
begin
//FormCreateProzedur
end;


//Auf diese Prozedur kommt es an
procedure UKniffel.BRechnenClick(Sender: TObject);
var MaxCells, i : Integer; HighscorePl1, NamePl1 : String;
begin
  MaxCells:=20;
  HighscorePl1:=FKniffel.SGUnten.Cells[0,9];
  NamePl1:=FKniffel.EPl1.Text;
  with FHighscore.SGHighscore do begin
    for i:=1 to MaxCells do
      begin
          if HighscorePl1>Cells[2,i] then
             begin
               Cells[2,i]:=HighscorePl1;
               Cells[1,i]:=NamePl1;
             end;
      end;
  end;
end;



end.
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: Sa 18.06.05 20:57 
Ja und jetzt? :lol: Hab grad überhaupt keine Ahnung, was du von mir willst. ;)