Call procedures from different forms

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 04:59:06

The obvious solution is to move the MergeDatFile function into a common unit which can then be used by both form units.

I am assuming that the method is a method of TForm1 because it operates on the members of TForm1. In which case you would do the following:

  1. Expose the method as a public method.
  2. Arrange for the TForm2 instance to have access to an instance of TForm1.
  3. Call the method on the TForm1 instance.

If my assumption is incorrect then the method should be moved out of TForm1 into another unit that can be used by both of your forms.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!