重拾VB6(11.1):VB6对象导论笔记

本文标签重拾VB6

来自MSDN-2001-OCT: Visual Tools and Languages/Visual Studio 6.0 Documentation/Visual Basic Documentation/Using Visual Basic/Programmer’s Guide/Part 1: Visual Basic Basics/Programming Fundamentals/Working with Objects

 

(1)For simplicity, most of the material outside of this chapter won't make many references to an object's class. Just remember that the term "list box control," for example, means "an instance of the ListBox class."

(2)关于对象层次
    在VB6中至少有两种对象层次结构你必须要熟悉:(1)来自其他应用程序组件的对象层次结构;(2)Data Access Object的层次结构。
    在VB6中构成对象层次主要有两种手段:(1)Collections;(2)containers(比如窗体包含控件)。

(3)关于集合:
    集合对象里包含的对象称为集合对象的成员对象
    集合成员的index number从0开始编号
    要访问特定的成员,用名字或者编号,如下:

Controls("List1") 
Controls!List1 
Controls(3) 

    VB6里最常用到的集合对象:Forms,Controls,Printers。不过,据赵老虎说,Collection 不是一个基类或接口,它和 Forms、Printers 一样都是 IEnumVARIANT 的一个实现,看这个帖子8楼。

 

(4)关于容器:
    You can use the Container property to change an object's container within a form.
    The following controls can contain other controls: Frame control,Picture box control,Toolbar control

(5)关于New:
    Using New with the Set statement is faster and is the recommended method.
    You can't use New to create:A variable of any generic object type, or of any specific control type, or of any specific control.
    There are four generic object types in Visual Basic: Object, Form, Control, MDIForm. 注意,MDIForm只是为了以后的扩展,在程序中不要用它,而要用例如MDIForm1这样的具体类。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值