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]。

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

数控机床制造过程的碳排...

新的数控车床加工机制英文文献和中文翻译

抗震性能的无粘结后张法...

锈蚀钢筋的力学性能英文文献和中文翻译

未加筋的低屈服点钢板剪...

汽车内燃机连杆载荷和应...

审计的优化管理英文文献和中文翻译

新課改下小學语文洧效阅...

互联网教育”变革路径研究进展【7972字】

我国风险投资的发展现状问题及对策分析

网络语言“XX体”研究

张洁小说《无字》中的女性意识

LiMn1-xFexPO4正极材料合成及充放电性能研究

安康汉江网讯

麦秸秆还田和沼液灌溉对...

老年2型糖尿病患者运动疗...

ASP.net+sqlserver企业设备管理系统设计与开发