Showing a progress indicator without using a Multi Page control

The example in this section is similar to the example in the preceding section. However, this technique is simpler because it doesn't use a MultiPage control. Rather, the progress indicator is stored at the bottom of the UserForm - but the UserForm's height is reduced so that the progress indicator controls are not visible. When it's time to display the progress indicator, the UserForm's height is increased, which makes the progress indicator visible.

CD- The companion CD-ROM contains an example that demonstrates this technique. The file is ROM named ® progress indicator3 . xlsm.

Figure 15-7 shows the UserForm in the VBE. The Height property of the UserForm is 172. However, before the UserForm is displayed, VBA code changes the Height to 12 4 (which means the progress indicator controls are not visible to the user). When the user clicks OK, VBA code changes the Height property to 172 with the following statement:

Me.Height = 172

bdruurï.k:tarn IFurFMinl fHumFA^m}

EMS

m

P

limidimi Muinfc

PnMtlci iHerf

hrtii

F* rtJTtr >f -Kmt IM! ttLnrt K ■

IKwtHUll »Hh

-

-WW*-

*

umi

r

_äJ r

Iha^rni

A.

hsM

lÉdLnr»

LUCSM-

□ irtCSKXPL

;

n

■ It

i ■ Mjfr fatityiiKf *

— II « 1

letton ^jp'kr 'ÎTÎP» i^Hrtr

lyrir

i-lWi^JrtTn

Gf-nAq iiandà

ihdfaH.

um

i- ¡Hh -

L ■ ÎfJ

■ml Irfmi

'frwTnhr V ! "A

HrtT"

4

l> _

A.fw! ...

fwct

-»cuieiSw-Scr

C j^T rt" i£ri>tf;.-.J !

r^ii

POUt^fFTWI

£ ■ 'wP cvtMt fV K■

V

Figure 15-7: The progress indicator will be hidden by reducing the height of the UserForm. Figure 15-8 shows the UserForm with the progress indicator section unhidden.

A

G

1 ■ ■

1

m

HI

171

m loi

m

U

rtf

111

1

/*■>

U

191 4as

HOr

m

44H

JaJ

)

M

Aw ÇrHr^mÊu,

-

Ï5Ï

p

S*

3H

¿16

ta

frl^JllF run

i

B0

s

Ml

(M

Dr- or-fttc rc raitrc ta ■

J

¿W

h

■Cl

T

lu

4U

7

n

ldî

T

Ul

%n

4+i

i

HT

1ST

i r

1

1

¡g

III

b.U

Cm-tw

i *

1

1

1H

a

il

-iti

m

wmrirnm

4

n

417

ill

»1

1

H7

HI

13

173

i

V.L

TU

U

M

tu

—-I»—

t

JS)

TU

J|7

iJH

ws

JRI SOI

lu

il 7

-Hi

357

W

tt-

73? Km

<m

AM

»71

IT

W

lit.

rrc MI

™ .

à" .

fi

H

■ y Sfwci

" J

<

Figure 15-8: The progress indicator in action.

4 PREY

NEXT

0 0

Post a comment