Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rulers

Status
Not open for further replies.

goatsaregreat

Programmer
Mar 21, 2001
82
GB
Does anyone have any ideas as how to create/show a ruler on a form? I need to show the scale of a label. The label represents something that is approximately 8 inches wide by 12 feet long. I want to show a ruler on both sides so the user knows how long the object is without remeasuring. I have the width and length inputted on another form. These will already be inputted. I just need to create some kind of "measuring device". Please help me in this. TIA.
 
Hi,

I don't know if there is an 'all ready to use' control for this, but it should be fairly easy to draw a ruler directly on the form.
Use .scalemode to set the scale mode.
Make a loop form 0 to form1.scalewidth step 'your tick distance' and draw a vertical line at the top of the form inside the loop using .line
Same for the veritial ruler.

You could also make 2 loops if you want long and short ticks. in the outer loop you could write the numbers using .print and currentX and currentY.

I've used this technique to make an activeX that draws graphs on the fly for a web application and it works fine.
Let me know if you go this way and need more help.
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top