Types of Objects: Visual Basic is comprised of three fundamental object types called forms, controls, and modules, with the following definitions:

1。Forms are the same as windows。 A form is a class in the sense that you can have more than one instance of the same form。 Forms have properties, methods, and events。 A few examples are listed below:

546

Properties: Name, WindowState (normal,  maximized, minimized), FillColor

Methods: Show, Hide, Move

Events: Click, Paint, MouseMove, Load

2。Controls are objects that are placed on forms, such as Command Buttons, Combo Boxes, Text Boxes, and Menus。 Although you can create custom controls, the standard controls that come with Visual Basic  and  the controls that are available through third-party vendors are generally sufficient。 The properties, methods, and events vary by the type of control。   A  few examples  include the following:

Properties: Name,  Height,  Width,  FontName,  Visible, BackColor, Style

Methods: SetFocus, Move, Addltem, Refresh

Events: Click,  KeyPress, MouseMove, GotFocus, LostFocus

3。Unlike forms and controls that have predefined properties, methods, and events, code Modules are simply a repository for Visual Basic code。 Each code module has a declaration section and a code section。 Properties are defined in the declaration section。 Methods and events are defined in the code section with subroutines and  functions。  Subroutines and functions can be defined as public or private。 Private routines are only visible to other routines in the same code module。

Writing Visual Basic Code: There are generally four steps to writing a Visual Basic program:

l 。  Draw a form (window)。

2。Draw controls (buttons, combo-boxes, text-boxes, etc。) on the form。

3。Customize the properties of the controls。 For example, specify a caption for a command button。

4。Write the code for the associated events and create code modules as needed。

III。  Object-Based programming with Visual

Booch calls the conceptual framework for the object-oriented programming style the object model。 In order for a model to be object-oriented, he says it must have the major elements of abstraction, encapsulation, modularity, and hierarchy (inheritance)。 He also says that the minor elements of typing, concurrency, and persistence are useful, but not essential。 We will describe the capabilities and limitations of Visual Basic in terms of the elements of Booch’s object model [Booch 94]。 We begin with the four major  elements。

Abstraction: Abstraction denotes the essential characteristics of an object that distinguish it from all other kinds of objects and thus provides crisply defined conceptual  boundaries,  relative  to

the perspective of the viewer [Booch 94)。 A good abstraction is one that emphasizes the details that are important to the reader or user and suppresses details that are not [Shaw 84]。 Visual Basic is capable of representing abstractions quite well。 An object can be built in such a way that its interface provides its essential behavior, and nothing more。

Encapsulation: Abstraction    and    encapsulation     are complementary concepts。 Abstraction defines the objects interface or the external view。 Encapsulation hides the implementation of the object from the outside view。 Booch defines encapsulation as "the process of hiding all of the details of an object that do not contribute to its essential characteristics“ [Booch 94]。

上一篇:船舶系泊定位系统英文文献和中文翻译
下一篇:电液系统的输出反馈非线性控制英文文献和中文翻译

移动码头的泊位分配问题英文文献和中文翻译

纤维素增强的淀粉-明胶聚...

多极化港口系统的竞争力外文文献和中文翻译

阻尼减震平台的设计英文文献和中文翻译

超精密自由抛光的混合机...

旋转式伺服电机的柔性电...

过程约束优化数控机床的...

人事管理系统开题报告

淮安市老漂族心理与休闲体育现状的研究

适合宝妈开的实体店,适...

组态王文献综述

浅谈动画短片《天降好运》中的剧本创作

紫陵阁

林业机械作业中的安全性问题【2230字】

弹道修正弹实测弹道气象数据使用方法研究

大学生就业方向与专业关系的研究

小学《道德与法治》学习心得体会