|
-
Sep 27th, 2000, 10:12 AM
#1
Thread Starter
Hyperactive Member
In my code below, the CurrentX and Y coordinates change at random between 1000 and 2000.
How can I get the currentX and currentY of the string 'word'? Is it possible?
Thanks!
-----
Private Sub Command1_Click()
Randomize
Dim word As String
Dim xcoord As Integer
Dim ycoord As Integer
word = "hello"
xcoord = Int(Rnd * 1000) + 1000
ycoord = Int(Rnd * 1000) + 1000
Picture1.Cls
Picture1.CurrentX = xcoord
Picture1.CurrentY = ycoord
Picture1.Print "I just want to say " & word & " to you all"
End Sub
Private Sub Command2_Click()
'what code goes here to make the CurrentX,currentY appear in Picture2?
End Sub
-
Sep 27th, 2000, 10:56 AM
#2
Code:
xPosWord = xcoord + Picture1.TextWidth("I just want to say ")
'Don't forget the trailing space
yPosWord = ycoord
-
Sep 27th, 2000, 10:57 AM
#3
_______
<?>
Code:
Public curX As String, curY As String
Private Sub Command1_Click()
Randomize
Dim word As String
Dim xcoord As Integer
Dim ycoord As Integer
word = "hello"
xcoord = Int(Rnd * 1000) + 1000
ycoord = Int(Rnd * 1000) + 1000
Picture1.Cls
Picture1.CurrentX = xcoord
Picture1.CurrentY = ycoord
Picture1.Print "I just want to say " & word & " to you all"
curX = Picture1.CurrentX
curY = Picture1.CurrentY
End Sub
Private Sub Command2_Click()
Picture1.CurrentX = 10
Picture1.CurrentY = 10
Picture1.Print curX & " " & curY
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
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
|