Stephen Lebans Forms: Formatting Labels/Data

G

Guest

Hi:

Per a suggestion on this forum, I downloaded Stephen Lebans zip file so I
can center text on labels and form fields. I looked at the example of what he
did and that's exactly what I want. However, there is no explanation of how
he did such, at least I can't find one.

I tried comparing the properties of two form fields, one centered and one
which was the traditional Access set up aligned with the top of the box. For
the life of me, I can't figure out which properties he modified that moved
text to the center of the box.

Can someone please help?

Thanks,
Robert
 
P

Philo Hamel via AccessMonster.com

If it would be possible to do this with the standard properties, Stephen
wouldn't have made the sample database ;)

Check out the Modules and Customer forms VB-script.

Later,
Philo
 
A

Al Camp

Robert,
I just took a quick peek at Stephen's code...
Did you look at the "external" Module that came with the file? That's
where all the centering code is.
The form just calls the centering function from the Module.

Al Camp
 
G

Guest

Hello Al:

I thought the answer was somewhere to be found in the field or label's
Proprerties Box. But I finally figured out the modifications were done via
coding and a function. Now I have to figuure out exactly how it works.

Thanks,
Robert
 
S

Stephen Lebans

The logic is,
For each selected TextBox control in the Detail section:
1) Determine the height of the control's contents
2) Set the TextBox Top Margin property to simulate Centered for a
Vertical Alignment prop

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top