Word Document Properties


Chapter 7: Interacting with the User



Download 8,82 Mb.
Pdf ko'rish
bet149/207
Sana16.03.2022
Hajmi8,82 Mb.
#496217
1   ...   145   146   147   148   149   150   151   152   ...   207
Bog'liq
VBA For Dummies 5th Ed.pdf ( PDFDrive )

Chapter 7: Interacting with the User
12_046500 ch07.qxp 12/5/06 5:35 PM Page 173


Every control should have a 
Caption
property entry. If the control doesn’t
provide a 
Caption
property (such as a 
TextBox
control), make sure that
you add a 
Label
to act as a prompt for the control.
Making your form pretty
Creating a neat appearance for your form is important. You want to use a
form that looks nice because the appearance of the form affects the attitude
of those who use it. VBA provides a number of options in the Format menu
for making your form look nice. These same options appear on the UserForm
toolbar in button form (see Figure 7-7).
Notice that some of the buttons on the UserForm toolbar have down arrows
associated with them. Click the down arrow, and you see a list of potential
button functions for that button. Select the option that you want to use.
Aligning controls begins when you select two or more controls on the same
form, as shown in Figure 7-7. Use a Ctrl+left-click to select each control in
turn. The last control that you select acts as the guide for aligning the other
controls, so make sure that the last control is in the position that you want
to use for the other controls. If you want to align the tops of the controls,
choose the Format

Align

Tops command. You can perform tasks such as
centering individual controls by using the Format

Center in Form menu
options.
Figure 7-7:
Make your
form look
nice by
using the
Designer
window
features.
174
Part II: Learning the Ropes 
12_046500 ch07.qxp 12/5/06 5:35 PM Page 174


Creating a connection between 
forms and modules
Generally, you need to make some type of connection between a form and
a module to display the form. The user can only access 
Sub
s contained in a
module through the Macro dialog box. Consequently, the code you include
with a form should affect only the handling of data locally to that form. When
you want to interact with the user programmatically, you use a module. The
example in this section shows how to display a form from a module. You’ll
see a number of other examples of interactions between forms and modules
as the book progresses.
Displaying a form onscreen is easy. Access the form by simply using its name,
and use the 
Show
method to display it, as shown in Listing 7-7.

Download 8,82 Mb.

Do'stlaringiz bilan baham:
1   ...   145   146   147   148   149   150   151   152   ...   207




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish