Bottom aligned text...

K

KHV

Text Box => How can I make the text be bottom aligned ? By code perhaps ?

Thank's
Kjartan
 
S

Stephen Lebans

By manipulating the TextBox's Top property you can achieve the desired
vertical alignment. For sample code see:
http://www.lebans.com/verticaljustification.htm
VerticalJustificationA2K.zip is a database containing a function to
allow for vertical centering of the contents of a Label or TextBox
control. Works with both Forms and Reports.

Access 2000 only!

--

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

KHV

Stephen,
Thank You very much. This is excactly what I needed to get onto the right
track...
I will though need to figure out how to treat longer text spanning more than
one line. How to get the text length and height and calculate the text box
top margin...
 
S

Stephen Lebans

The code I pointed you to is a multiline solution and obviously contains
code to calculate the width and height of multiple lines of text.

Only one small change is required to modify the current vertically
centered output to vertically bottom output.

Open the sample Report in Design view.
From the Menu select View->Code
Find the Sub named "VerticallyCenter"
Change the last line to read:
ctl.TopMargin = (ctl.Height - (lngHeight + 70))

The value of 70 is 1/5 of an inch(1440 TWIPS per Inch) margin for the
bottom of the TextBox/Label control.

--

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

Guest

Stephen do you have a solution that would work in access 2002 or even better
any version from 2000 up?
 
S

Stephen Lebans

You lost me Michael. The sample I referenced is an A2K MDB and will
directly convert to any later version of Access.

--
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