摘要
在设计基于VBA的Word试题模板时,发现在VBE环境下无控件数组,使得同类控件只能有分开的不同的事件过程,导致编程效率低。本文通过类设计实现同类控件具有相同的事件过程。在控件类的设计过程中,从类的概念和实践出发,得出控件可类化的一些属性和事件过程,对类属性的初始化采用了直接和间接的两种方法,给出了利用复选按钮进行单项选择的关键技术代码。
When the Word exam template on VBA is designed, VBE has not control array.The similar control have different events process.Programming is low efficiency. This paper realizes that similar control have the same event process through the class design. In the control-class design, from the concept of class and the practice, some properties and events process are generalized on control class.Two methods of the direct and indirect initialize the class attribute.The code of key technology is given,when check buttons realize the single item choice.
出处
《软件》
2012年第8期42-43,共2页
Software
关键词
控件类
控件可类化的特征
属性初始化方法
Control class
Control characteristic on class
Method of attribute-initialization