掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
ユニット分割について (ID:149980)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
おばんさまです。 先日はありがとうございました。 別ユニットについて、あの後いろいろ試してみているんですが 別ユニットでフォームと画像の動的生成を行った場合、同一の場合は機能していたんですが、 別ユニットにするとonclickイベントがエラーになってしまい定義ができない状態になってしまいました。 多分、onclickの親が何?というような話だと思うのですが アドバイスいただけますと助かります。 Main ----------------------------------- implementation uses sample_module; procedure TForm1.Button1Click(Sender: TObject); begin go(sender,self); end; ----------------------------------- sample_module.pas ----------------------------------- unit sample_module; interface uses Dialogs,forms,ExtCtrls,Graphics; procedure go(sender:tobject;form:tform); procedure aaa(Sender: TObject); implementation procedure aaa(Sender: TObject); begin showmessage('xxx'); end; procedure go(sender:tobject;form:tform); var ti:timage; tf: TForm; begin tf:= TForm.Create(nil); tf.Caption := 'overlay'; tf.FormStyle:=fsStayOnTop; tf.width:=200; tf.Height:=200; tf.Show; ti:=TImage.Create(nil); ti.Parent:=TForm(tf); ti.Transparent := True; ti.Canvas.Ellipse(0,0,100,100); ti.OnClick :=aaa(); end; end. -----------------------------------
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.