Regain VB6 (11.1): VB6 object introduction notes

Source: Internet
Author: User

Label: Regain VB6

From MSDN-2001-OCT: visual tools and programming ages/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 sure references to an object's class. Just remember that the term"List box Control, "For example, means"An instance of The ListBox class."

(2) object Layers
You must be familiar with at least two object hierarchies in VB6: (1) object hierarchies from other application components; (2) Data Access Object hierarchies.
There are two main methods to construct an object hierarchy in VB6: (1) collections; (2) Containers (such as a form containing controls ).

(3) about set:
The objects contained in the collection object are called Member objects of the collection object.
The index number of the Set member starts from 0.
To access a specific member, use the name or number as follows:

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

The most common collection objects in VB6 are forms, controls, and printers. However, according to Zhao Tiao, collection is not a base class or interface. Like forms and printers, it is an implementation of ienumvariant. Please refer to the eighth floor of this post.

 

(4) about containers:
You can use the container property to change an object's witiner within a form.
The following controls can contain other controls: frame control, picture box control, Toolbar Control

(5) about 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. note that mdiform is only for future extension Instead of using it in sequence, use a specific class such as mdiform1.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.