Print on Form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shaiful
    New Member
    • Oct 2007
    • 89

    Print on Form

    Hi all, I have a very small problem that i want to print on form, I wrote code under commandbutton1:
    Dim MyVar
    MyVar = "Hello."
    Debug.Print MyVar

    but it doesnt work? could u pls tell my how i can just put a line on form on left top corner? Thx a lot
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    just use

    Print myvar

    Comment

    • shaiful
      New Member
      • Oct 2007
      • 89

      #3
      Originally posted by debasisdas
      just use

      Print myvar


      Hi, I used this but its say " Object doesnt support this property or method

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        are you using vb 6.0 ?

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          You have to use the appropriate method (in VB6, generally the Print method) of a particular object. For example to print on Form1, you would use Form1.Print or to print on the actual printer, use Printer.Print.

          When you use Debug.Print, it prints to the "immediate window". That is the window where VB shows any debugging info. This is only available in the IDE, not at runtime.

          Comment

          Working...