How can I position characters in my picturebox? Is using CurrentX and Current Y the only way?
Thanks for any help!
Printable View
How can I position characters in my picturebox? Is using CurrentX and Current Y the only way?
Thanks for any help!
You could put a label inside the picture box
and write to the label.
Without using a Label, yes, CurrentX and CurrentY are the only ways, but if you do not want to use them, you can add blank spaces before your word. For example " Hello".
Also, when working with Character's, it's a good idea to set the ScaleMode to Character.
What a pity that CurrentX and CurrentY is the only way. Hopefully this will change in future releases of VB (who could I suggest this to?).
I have lots of text and symbols have to be inserted after each sentence, so it looks like I'll have to get the coordinates where each sentence ends, insert the symbol at that point, blah, blah, blah.....
Megatron, why is it a good idea to set scalemode to 'Character'? What difference does it make?
Thanks.
It makes it easier because it's about the width of a character. So instead of talking in terms of twips (120's 240), you talk in terms of 1's and 2's.
If you Put a semicolon after the Print Statement the Currentx and CurrentY properties are automaticly set to the end of the Statement you Print
For example
PrintsCode:Picture1.Print "Hello "
Picture1.Print "Everyone"
Hello
Everyone
PrintsCode:Picture1.Print "Hello ";
Picture1.Print "Everyone"
Hello Everyone
But there are some occasions where you do not want to print directly to the next line or end of the statement. If that is the case, setting the ScaleMode to Character will help greatly.
Thanks both for your help,
Sam, that is exactly what I am looking for. Thanks a lot. From now on life is different.
I was not looking forward to having to place every single symbol individually - and then if we decide to change the hints, the nightmare starts again, as we have to reposition every symbol. With this, the picture box can do everything.
It also eradicates the 'random' problem, because some numbers can be 1, 100, 2000 etc, and if you position it with currentX and currentY you can get overlaps.
The way to go:
Private Sub Command1_Click()
Dim anynumber As Integer
Randomize
anynumber = Int(Rnd * 2000)
Picture1.Print "yada yada " & anynumber & " ";
Picture1.Font = "symbol"
Picture1.Print "Ð"
Picture1.Font = "comic sans ms"
End Sub