1 / 7

富融科技有限公司 版权所有 What’s New in ArcInfo 8.0

8. ArcInfo. 16 、对象程序设计. 富融科技有限公司 版权所有 What’s New in ArcInfo 8.0. 理解对象. 对象和类 定义自己的类 实例化:创建对象 申明及设置对象变量. 富融科技有限公司 版权所有 What’s New in ArcInfo 8.0. 对象( Object ). 对象是内存里的一块代码(程序)

prue
Download Presentation

富融科技有限公司 版权所有 What’s New in ArcInfo 8.0

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 8 ArcInfo 16、对象程序设计 富融科技有限公司 版权所有 What’s New in ArcInfo 8.0

  2. 理解对象 • 对象和类 • 定义自己的类 • 实例化:创建对象 • 申明及设置对象变量 富融科技有限公司 版权所有 What’s New in ArcInfo 8.0

  3. 对象(Object) • 对象是内存里的一块代码(程序) • 对象可能没有可视的成分 • control, form, layer等可见 • 指向所选记录的指针则不可见 • 对象从类创建得来 • 对象是类的实例 富融科技有限公司 版权所有 What’s New in ArcInfo 8.0

  4. 类(Class) • 类是对象的模板 • 类定义对象的属性和方法 • 例:button属于Button类 • Button类定义所有的button属性 • 创建的所有buttons都共享相同的属性 • 所有的buttons都以相同的方式工作 • 可以创建自己的类 • 类的代码存在类模块(class module)中 • 属性:变量 • 方法:过程 富融科技有限公司 版权所有 What’s New in ArcInfo 8.0

  5. 创建对象 • 设计时 • 在ArcMap中,用客户化对话框 • 在VBA中,用toolbox • 运行时 • 用已有对象 • Dim myButton As Button • Set myButton = frmMain.btnClick • 用New关键字 • Dim myList As Collection • Set myList = New Collection 富融科技有限公司 版权所有 What’s New in ArcInfo 8.0

  6. 方法 对象 属性 DOG Name Color Bark Growl CallPet 对象 Get & Set Get only 富融科技有限公司 版权所有 What’s New in ArcInfo 8.0

  7. DOG Name Color Bark Growl CallPet VB代码例: 对象 • pDog是dog类的一个对象实例 • Dim 声明变量 • Set 设置一个对象变量 • New 创建一个新的对象 例; Dim pDog as Dog Set pDog = New Dog pDog.Bark 富融科技有限公司 版权所有 What’s New in ArcInfo 8.0

More Related