Thread

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Doug Bell

    Thread

    Hi,
    I have an application that is required to print labels.

    One issue that I would like to clean up is that the application hangs for a
    time while it prints the required label.

    I have a Class to take care of the printing.

    Could someone explain how I can call this class and have it run in another
    thread so that it goes off and prints in the background?

    Thanks

    Doug


  • shiv_koirala@yahoo.com

    #2
    Re: Thread

    Using systems.threadi ng
    Dim objclass1 as new class1
    Dim Thread1 as New System.Threadin g.Thread(Addres s of
    objclass1.print ())

    Just in case http://www.startvbdotnet.com/threading/default.aspx

    Shivprasad Koirala
    C# , VB.NET , SQL SERVER , ASP.NET Interview Questions
    Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!


    Comment

    • Dick Grier

      #3
      Re: Thread

      One more step after the last that Shivprasad listed.

      Thread1.Start

      Make sure that your print method exits when it is finished, so that the
      associated thread is terminated.

      --
      Richard Grier (Microsoft Visual Basic MVP)

      See www.hardandsoftware.net for contact information.

      Author of Visual Basic Programmer's Guide to Serial Communications, 4th
      Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
      www.mabry.com/vbpgser4 to order.


      Comment

      • Doug Bell

        #4
        Re: Thread

        Thanks Shiv

        <shiv_koirala@y ahoo.com> wrote in message
        news:1124266051 .633337.43550@g 14g2000cwa.goog legroups.com...[color=blue]
        > Using systems.threadi ng
        > Dim objclass1 as new class1
        > Dim Thread1 as New System.Threadin g.Thread(Addres s of
        > objclass1.print ())
        >
        > Just in case http://www.startvbdotnet.com/threading/default.aspx
        >
        > Shivprasad Koirala
        > C# , VB.NET , SQL SERVER , ASP.NET Interview Questions
        > http://www.geocities.com/dotnetinterviews/
        >[/color]


        Comment

        • Doug Bell

          #5
          Re: Thread

          Thanks Dick

          "Dick Grier" <dick_grierNOSP AM@msn.com> wrote in message
          news:O36nhH0oFH A.2916@TK2MSFTN GP14.phx.gbl...[color=blue]
          > One more step after the last that Shivprasad listed.
          >
          > Thread1.Start
          >
          > Make sure that your print method exits when it is finished, so that the
          > associated thread is terminated.
          >
          > --
          > Richard Grier (Microsoft Visual Basic MVP)
          >
          > See www.hardandsoftware.net for contact information.
          >
          > Author of Visual Basic Programmer's Guide to Serial Communications, 4th
          > Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
          > www.mabry.com/vbpgser4 to order.
          >
          >[/color]


          Comment

          Working...