PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
VS 2008 Print button-VBForums
Results 1 to 2 of 2

Thread: Print button

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2010
    Location
    Ireland
    Posts
    85

    Print button

    My program is almost working, only thing I'm missing is a print button and I've been reading about the classes etc that need to be written, but I can't get a handle on it...

    Can anyone show me an example of a print class or printing?

    All I need to do is print "template.txt"

    Thanks guys

  2. #2
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: Print button

    vb.net Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         Dim PrintTextFile As New ProcessStartInfo
    3.         PrintTextFile.UseShellExecute = True
    4.         PrintTextFile.Verb = "print"
    5.         PrintTextFile.WindowStyle = ProcessWindowStyle.Hidden
    6.         PrintTextFile.FileName = "C:\template.txt"
    7.         Process.Start(PrintTextFile)
    8. End Sub
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width