Viewing Objects Using the Object Browser

Now that you understand what objects and their respective properties, methods, and events are, let's look at another way to view objects. The Object Browser is a tool that allows you to view and manage the objects in your application. You can use the Object Browser to learn about the objects available in Access 2003 as well as objects available from any Windows program.

The Object Browser can be opened from the Visual Basic Editor in one of three ways: by choosing the Object Browser button on toolbar, by selecting View C> Object Browser, or by pressing F2. Any of these will result in a screen such as the one shown in Figure 3.15.

*AII Libraries:*

Classes

Members of <çjlobals>

0 j =:glob3ls> j a AccessObject

cd cd

A_ADD A_ALL

i

AccessObjectFroper

cd

A_ANYYVHERE

HI AccessObjectFroper

cd

A_ATTACH

jp AcCloseSave

cd

A_COPY

ip AcColorlntlex

cd

A_CURRENT

-Jp AcCommand

cd

A_CUT

■=p AcControlType

Ju

A_DELETE

ip AcCurrentView

cd

A_DELETE_V2

■Jp AcDataAccessPage^

cd

A_DESIGN

iP AcDataObjectType

cd

A_DIAL0G

ip AcDataTransferType

Ar-n of'./i ûMr V

cd

A_DOWN

,"n

A noicT

v

<AII Libraries>

Notice how the Libraries drop-down list currently displays All Libraries. The values displayed in the Classes list are for the Classes of All Libraries. You can select a particular Library, such as Access, to limit the list of Classes and corresponding Class Members that are displayed (Figure 3.16).

Access

*

*

J

M

V

Glasses

Members of Form

iffliFomn

-

p MouseUp

® FormatConclition

ß MouseW'heel

iS Formate on ditions

[Sir r.loLiseWheel

Iii Forms

m Move

© GroupLevel

l^r Moveable

iä® Hyperlink

isf* Name

IS Image

gfr NavigationELittons

IS Label

i^? NewRe cord

jfe Line

[il

& QnActivate

IS ListBox

l^f OnApplyFilter

m Module

oir OnClick

Iii Modules

äP OnClose

ij*J nhi r^rnü

>7 ("1 n p n p r+

E.-snt P.louseUplEüfio,' As !nt&00r, .Sfiiff^jSInteger, X As Single, Y As Single) Msnntsrof ss.J n

Figure 3.16

Notice how you can drill down into the Classes and view the properties, methods, and events available for the selected class. In the previous example, the Access Form class is selected, and you can see MouseUp and MouseWheel events (as indicated by the lightening bolt icon), various properties such as MouseWheel, and various methods such as Move. Notice how in this example the MouseUp event is selected, and you can see the syntax for the event in the bottom portion of the display. You can see why the Object Browser is a very useful tool for viewing and working with objects.

If you change the Libraries list to the current project, you see the frmTestObjects form (Figure 3.17).

Double-click on the Form_frmTestObjects class name to display a code window showing the sub procedures and functions for that class module. In this example, you see the event procedures created earlier in this chapter for the frmTestObjects form.

0 0

Post a comment