|
-
Sep 26th, 2000, 01:49 PM
#1
Thread Starter
Lively Member
Hi,
I'm having a bit of trouble positioning. Could you help me?
I've made a function that displays fractions in the form:
6
--- (as opposed to 6/7)
7
The fractions will appear in a Picturebox, and I'll be calling the function many times throughout my project.
However the text before the fraction can change, so I can't hardcode the position of the fractions. I've posted my function below with an example of a call from Command1. How can I have it so that the bottom part (in the above example '7'), is always directly under the top part '6'?
Thanks!
---------
Private Sub Command1_Click()
Dim number As Integer
Dim number2 As Integer
Randomize
number = Int(Rnd * 200)
number2 = Int(Rnd * 200)
Picture1.Cls
Picture1.FontSize = 14
'this text can change
Picture1.Print "And the answer is: ";
Picture1.Print WriteUnderline(number, number2)
End Sub
Public Function WriteUnderline(X As Integer, y As Integer) As String
Picture1.Font.Underline = True
Picture1.Print X;
Picture1.Font.Underline = False
'don't know how to do this part - just took a wild guess.
Picture1.CurrentX = TextHeight(X)
Picture1.CurrentY = TextWidth(X)
Picture1.Print y;
End Function
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
|