|
-
Jan 6th, 2003, 11:13 AM
#1
Thread Starter
Hyperactive Member
How to align the character to a common baseline??
Hello Every1,
I have a doubt,
Now I'm displaying some characters ina picturebox with the print statement. I'm also changing the font.
Follow these statements
Picture1.FontSize=10
Picture1.Print "A"
Picture1.FontSize=12
Picture1.Print "A"
The problem is, both the 'A' are not on the same base line. The bigger A is moving some pixels down. Can any1 tell me a logic so that the program calculates the size of the characters and align them perfectly on the same baseline.
If Not VB Then Exit
------------------------------------------------
visit me @ http://mzubair.50g.com/
-
Jan 6th, 2003, 02:07 PM
#2
I'm not sure if you can print more on one line after you have printed something on it...but if you print all at the same time, it should work fine...
-
Jan 6th, 2003, 02:47 PM
#3
Frenzied Member
i know one way, but there must be a better one..
make a label and set autosize to true....
then set the caption of the label to the "A" and see the .with and .height properties...
then to set the position where to draw: .cyrrentx and .currenty
-
Jan 6th, 2003, 03:21 PM
#4
heheheeh....nice one Cyborg...
-
Jan 6th, 2003, 04:20 PM
#5
-
Jan 6th, 2003, 05:11 PM
#6
Don't know if it's possible with pure VB, but you can use the SetTextAlign API to specify that the y coordinate you pass to the TextOut API family is the baseline of the characters, not the top line.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 6th, 2003, 06:43 PM
#7
Good Ol' Platypus
It wouldn't matter, because VB6 has the handy TextHeight function, you can just subtract it from the Y value and you have it lined up.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Jan 7th, 2003, 08:27 AM
#8
Fanatic Member
Picture1.FontSize=10
Picture1.Print "A"
currenty = 0 'im not sure if this works
Picture1.FontSize=12
Picture1.Print "A"
One thing I noticed when I transfered from QB to VB was that they got rid of locate (to put where text goes) and that text overlaps now and you have to erase it yourself! (GRRRRRR )
Another thing I noticed was that if I did a Line or Circle command, it would print where I last started something.. hmmmm 
Then I found out currentx and currenty are used to place text.
Don't pay attention to this signature, it's contradictory.
-
Jan 7th, 2003, 03:30 PM
#9
Frenzied Member
you have to use the Picture1.CurrentY....if you just type CurrentY its the Form property...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|