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!

Drawing Text on a Form 1

Status
Not open for further replies.

Tim8w

Programmer
Apr 8, 2003
44
US
All I need to do is draw some text on a form at a given location. Is there a simple way to do this? Or do I have to call the gdi function DrawText?

Thanks
 

Here is a modification from thread222-543767. In this I have changed Picture1 to Me. To test start a new project and copy the following code into the forms code window.
[tt]
Option Explicit

Private Sub Form_Load()
Me.Width = 8000
Me.Width = 7800
Me.AutoRedraw = True
Me.Print "This Is A Test"
Me.Print "This is only a test."
Me.Print "Remember this is just a test."
Me.CurrentX = Me.TextWidth("This Is A Test")
Me.CurrentY = 0
Me.Print "."

Me.CurrentY = 0
Me.CurrentX = Me.TextWidth("Remember this is just a test.") + 500
Me.Print &quot;<Was missing peroid, looks like vbProperCase.&quot;
Me.CurrentX = Me.TextWidth(&quot;Remember this is just a test.&quot;) + 500
Me.Print &quot;<only a test of what?&quot;
Me.CurrentX = Me.TextWidth(&quot;Remember this is just a test.&quot;) + 500
Me.Print &quot;<shouldn't that have a comma after remember?&quot;

End Sub
[/tt]

Good Luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top