• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 176
  • Last Modified:

text and graphics

how do you place text on a form without using control boxes and without changing the graphics coordinates .

ie I want to draw lines and next to the lines put there length The number of lines is specified by the user
0
cathyis5
Asked:
cathyis5
1 Solution
 
ggilmanCommented:
You don't mention but I'm assuming Visual Basic. To do this, change your x,y positon with CurrentX and CurrentY. Then put text on the form with "Print" command, as below. I'm not positive if this changes the "graphics" coordinates as you mention but if it does, just store off the CurrentX and CurrentY like oldX = form1.CurrentX, then reset them after you are done.
If you're not using Visual Basic I guess you can reject the answer.

Private Sub Command1_Click()
    Form1.CurrentX = 500
    Form1.CurrentY = 100
    Print "My Text"
End Sub

BTW, something else you may be interested in if you don't already know about it you can use textHeight and textWidth. They tell you the height/width of the text to be printed. Use it like Form1.textHeight("My Text") and you will be able to see how high the text will be. Just sounded useful if you're going to have lines going between the text. ;)
0
 
cathyis5Author Commented:
thanks - I will try it
0

Featured Post

Evaluating UTMs? Here's what you need to know!

Evaluating a UTM appliance and vendor can prove to be an overwhelming exercise.  How can you make sure that you're getting the security that your organization needs without breaking the bank? Check out our UTM Buyer's Guide for more information on what you should be looking for!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now