Results 1 to 2 of 2

Thread: print to control

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Location
    Brigham City, UT
    Posts
    1

    Question

    Help! I am a beginning student in VB, working from Deitel, Deitel, and Nieto's VB6 How To Program. I have an assignment to print a series of asterisks to a picture box using a loop and the print statement. I have it all working except the output keeps coming up on the form, instead of my picture box (which is within a frame). On page 374, Fig. 9.4, it clearly states that method Print "draws text on a form or control." But it does not say how. I have checked object names for typos, the command is set up (for now) in the Click event for the picture box, but it still goes to the form. Wassup widdat?
    Frodo LIVES!!

  2. #2
    Guest
    You must specify what you want to print to. Have you typed Picture1.Print "*"? If so, it should work.

    For example sake, make a Form with a PictureBox on it and insert the following code in the Picture's Click event.

    Code:
    Private Sub Picture1_Click()
    
    For i = 1 To 10
        Picture1.Print "*"
    Next i
    
    End Sub
    This should Loop 10 times and print the * character 10 times.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width