Hej Finn Bindeballe
Prøvede at kalde en procedure fra en anden Unit volder mig stadig problemer!
I Unit3 kalder jeg en procedure i Unit4 med navn: btnClear.Click; // Clear
image1 men det funger ikke!
Vil du rette Unit3 og Unit4 så de kan "snakke sammen".
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Printers, Unit1;
type
TForm3 = class(TForm)
Button1: TButton;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
procedure Button1Click(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
implementation
uses Unit4;
{$R *.dfm}
procedure TForm3.RadioButton1Click(Sender: TObject);
Var
N:Integer;
begin
Memo1.Clear;
btnClear.Click; // Clear image1
For n:=1 to 18 do begin
unit Unit4;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, Math, Spin, jpeg, ExtDlgs, printers,Unit3;
btnClear: TButton;
procedure btnTegnClick(Sender: TObject);
procedure seVinkelChange(Sender: TObject);
procedure btnClearClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmProfil: TfrmProfil;
V: Real;
zoom:integer;
implementation
{$R *.dfm}
procedure TfrmProfil.btnClearClick(Sender: TObject);
var
r: TRect; // Firkanten der definerer image-vinduet.
begin
with Image1 do
begin
Picture := nil; // Fjern det billede der er der.
// prøv at finde firkanten med windows-funktionen
if not Windows.GetClientRect(Handle, r) then
// ellers bare brug width / height af image.
r := Rect( 0, 0, Width, Height);
Canvas.FillRect( r); // fyld imagevinduet med hvid.
end;
end;
procedure TfrmProfil.FormResize(Sender: TObject);
begin
btnClear.Click; // Clear image1
btnTegn.Click; // Gentegn profilen.
end;
Med venlig hilsen
Monie
"Finn Bindeballe" <finnb@post6.tele.dk> skrev i en meddelelse
news:3D5A0BB1.7C5783C8@post6.tele.dk...
> hejsa........
>
>
> du skal i unit3, under uses includere 'uses unit4', og i unit 4 skal du
> huske at de procedure og functioner du vil bruge fra andre units skal
> staa listet under interface....
> som her..
>
> ------------------------------------------------------------------
> unit CCnetComPort;
>
> interface
>
> uses
> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
> Dialogs,
> OoMisc, AdPort,extctrls,contnrs,stdctrls,DebugF;
>
> type
> procedure StrToList(s:String; var l:Tstringlist);
> Function listToStr(l:Tstringlist):String;
>
> procedure Register;
>
> implementation
>
> procedure Register;
> begin
> RegisterComponents('CCNET', [TCnetComPort,TIRControl]);
> end;
> --------
> dine egne procedure og functioner.........
> -------
> end;
> ---------------------------------------------------------------------
>
> /finn
>
>
|