Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. form_load and performclick()

form_load and performclick()

Scheduled Pinned Locked Moved C#
help
10 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Saamir
    wrote on last edited by
    #1

    Hi guys, Need some help please. I have a scan feature in my form and on form_load I am trying to fire the btnScan.performclick() event. It works but my form doesn't load until scanner times out or then I scan. I want the form to load and the picturebox to show no image while the scanner is waiting for an image. I hope I am making sense. Sameer

    Sameer

    V P D 3 Replies Last reply
    0
    • S Saamir

      Hi guys, Need some help please. I have a scan feature in my form and on form_load I am trying to fire the btnScan.performclick() event. It works but my form doesn't load until scanner times out or then I scan. I want the form to load and the picturebox to show no image while the scanner is waiting for an image. I hope I am making sense. Sameer

      Sameer

      V Offline
      V Offline
      vineas
      wrote on last edited by
      #2

      Have a timer that gets started in the form load event, and then do the btnScan.PerformClick() in the timer's event handler.

      ----- In the land of the blind, the one eyed man is king.

      S 1 Reply Last reply
      0
      • S Saamir

        Hi guys, Need some help please. I have a scan feature in my form and on form_load I am trying to fire the btnScan.performclick() event. It works but my form doesn't load until scanner times out or then I scan. I want the form to load and the picturebox to show no image while the scanner is waiting for an image. I hope I am making sense. Sameer

        Sameer

        P Offline
        P Offline
        Pedram Behroozi
        wrote on last edited by
        #3

        I think you need Threading[^]

        While (true) { Human.isLearnable = true; }

        S 1 Reply Last reply
        0
        • P Pedram Behroozi

          I think you need Threading[^]

          While (true) { Human.isLearnable = true; }

          S Offline
          S Offline
          Saamir
          wrote on last edited by
          #4

          can you please give me an example Thanks

          Sameer

          P D 2 Replies Last reply
          0
          • S Saamir

            can you please give me an example Thanks

            Sameer

            P Offline
            P Offline
            Pedram Behroozi
            wrote on last edited by
            #5

            Sure[^]

            While (true) { Human.isLearnable = true; }

            1 Reply Last reply
            0
            • S Saamir

              can you please give me an example Thanks

              Sameer

              D Offline
              D Offline
              DaveyM69
              wrote on last edited by
              #6

              For simplicity - use the BackgroundWorker component.

              Dave
              BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
              Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

              S 1 Reply Last reply
              0
              • S Saamir

                Hi guys, Need some help please. I have a scan feature in my form and on form_load I am trying to fire the btnScan.performclick() event. It works but my form doesn't load until scanner times out or then I scan. I want the form to load and the picturebox to show no image while the scanner is waiting for an image. I hope I am making sense. Sameer

                Sameer

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                You don't put all the code for doing the scan in the btnScan.Click event handler. You put it in it's own method somewhere, then you can call that method from anywhere in your code, including the btnScan.Click event handler AND from in your Load event.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008

                S 1 Reply Last reply
                0
                • D Dave Kreskowiak

                  You don't put all the code for doing the scan in the btnScan.Click event handler. You put it in it's own method somewhere, then you can call that method from anywhere in your code, including the btnScan.Click event handler AND from in your Load event.

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007, 2008

                  S Offline
                  S Offline
                  Saamir
                  wrote on last edited by
                  #8

                  Thank you Dave for your response. I tried your suggestion and it didn't work, I believe the problem is that I have a while loop that waits for a response from the scanner in my btnscan_click event. I instead added a timer and I am calling the btnScan.Performclick from there. That seems to be working, I am not sure if this is the best way to go with it but it works :) Sameer

                  Sameer

                  1 Reply Last reply
                  0
                  • V vineas

                    Have a timer that gets started in the form load event, and then do the btnScan.PerformClick() in the timer's event handler.

                    ----- In the land of the blind, the one eyed man is king.

                    S Offline
                    S Offline
                    Saamir
                    wrote on last edited by
                    #9

                    Thank you for your suggestion, it worked... :) S

                    Sameer

                    1 Reply Last reply
                    0
                    • D DaveyM69

                      For simplicity - use the BackgroundWorker component.

                      Dave
                      BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
                      Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

                      S Offline
                      S Offline
                      Saamir
                      wrote on last edited by
                      #10

                      Thank you Davey, I decided to go with a timer that calls the performclick event. Thanks S

                      Sameer

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups