问题描述
真的,我已经找到了答案,但我必须在某处遗漏一些语法...
我有一个弹出式日历,可用于多种形式。每个表单都需要日历自动将所选日期输入到指定的文本框中(此部分已经很好地工作),然后在连续表单上更新过滤器以包含该日期范围。
现在,我有几个需要这个弹出日历的表单,所以我试着让它尽可能通用,以便它可以处理所有这些。我设置了一个模块,允许以下全局变量:
公共目标为TextBox
公共formName为表格
在日历表格中,我有以下内容:
Really, i''ve looked for the answer, but I must be missing some syntax somewhere...
I have a popup calendar which is to be used across several forms. Each form will need the calendar to automatically enter the selected date into the designated textbox (this part works beautifully already) and then update the filter on a continuous form to include that date range.
Now, I have several forms which will be in need of this popup calendar, so I''m trying to make it as general as possible so it can handle all of them. I set things up with a module, allowing for the following global variables:
Public target As TextBox
Public formName As Form
In the calendar form, I have the following:
推荐答案
那里。
在我看来,最自然和最常用的方法是写类引发事件。
然后在类的表单模块对象中实例化并处理它的事件。
希望你有一些面向对象的东西节目。如果不是,请用这个相当简单的课程开始学习。
祝你好运。
P.S.我很乐意帮助您编码。
Hi, there.
The most natural and commom way to do it, to my mind, is to write Class that raises events.
Then to instantiate in form module object of the class and handle it''s events.
Hope you have some sence of object oriented programming. If no, start to learn it with this rather simple class.
Good luck.
P.S. I''ll be glad to help you with coding.
这篇关于跨表单调用子例程(非模块)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!