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. Visual Basic
  4. Cross threading..

Cross threading..

Scheduled Pinned Locked Moved Visual Basic
helpquestion
9 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
    Subjugate
    wrote on last edited by
    #1

    i have 2 textboxes and each of the textbox is running on different thread. If i wan to display the value which is on the txtbox1 to txtbox2 i have a error can cross-thread operation not valid. What should i do to solve tis problem?

    R D 2 Replies Last reply
    0
    • S Subjugate

      i have 2 textboxes and each of the textbox is running on different thread. If i wan to display the value which is on the txtbox1 to txtbox2 i have a error can cross-thread operation not valid. What should i do to solve tis problem?

      R Offline
      R Offline
      Rajesh Anuhya
      wrote on last edited by
      #2

      try this use files to trasfer data between your textboxes. write content of textbox1 text to a temporary file, read it from second thread and put it in the second textbox2.

      Rajesh B --> A Poor Workman Blames His Tools <--

      S D P 3 Replies Last reply
      0
      • R Rajesh Anuhya

        try this use files to trasfer data between your textboxes. write content of textbox1 text to a temporary file, read it from second thread and put it in the second textbox2.

        Rajesh B --> A Poor Workman Blames His Tools <--

        S Offline
        S Offline
        sph3rex
        wrote on last edited by
        #3

        Maybe using a delegate ...

        1 Reply Last reply
        0
        • R Rajesh Anuhya

          try this use files to trasfer data between your textboxes. write content of textbox1 text to a temporary file, read it from second thread and put it in the second textbox2.

          Rajesh B --> A Poor Workman Blames His Tools <--

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

          :wtf:

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

          P 1 Reply Last reply
          0
          • S Subjugate

            i have 2 textboxes and each of the textbox is running on different thread. If i wan to display the value which is on the txtbox1 to txtbox2 i have a error can cross-thread operation not valid. What should i do to solve tis problem?

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

            You cannot access controls from threads other than the one that created the control. It's also a really bad idea to create controls on anything other than the UI thread (the one the application started on). You might want to read this[^] and this[^].

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

            1 Reply Last reply
            0
            • R Rajesh Anuhya

              try this use files to trasfer data between your textboxes. write content of textbox1 text to a temporary file, read it from second thread and put it in the second textbox2.

              Rajesh B --> A Poor Workman Blames His Tools <--

              P Offline
              P Offline
              Paul Conrad
              wrote on last edited by
              #6

              Fatal Error wrote:

              use files to trasfer data between your textboxes. write content of textbox1 text to a temporary file, read it from second thread and put it in the second textbox2.

              Well, while that is possible to do so, it is not very efficient.

              "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

              1 Reply Last reply
              0
              • D Dave Kreskowiak

                :wtf:

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

                P Offline
                P Offline
                Paul Conrad
                wrote on last edited by
                #7

                Dave Kreskowiak wrote:

                :WTF:

                Yep. Almost made me gag on my coffee reading the suggestion of using files :laugh:

                "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

                D 1 Reply Last reply
                0
                • P Paul Conrad

                  Dave Kreskowiak wrote:

                  :WTF:

                  Yep. Almost made me gag on my coffee reading the suggestion of using files :laugh:

                  "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

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

                  Paul Conrad wrote:

                  Yep. Almost made me gag on my coffee reading the suggestion of using files

                  :-O I spewed Coke out my nose (:(() and onto my (work) laptop. Please, don't tell anyone! :-D

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

                  P 1 Reply Last reply
                  0
                  • D Dave Kreskowiak

                    Paul Conrad wrote:

                    Yep. Almost made me gag on my coffee reading the suggestion of using files

                    :-O I spewed Coke out my nose (:(() and onto my (work) laptop. Please, don't tell anyone! :-D

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

                    P Offline
                    P Offline
                    Paul Conrad
                    wrote on last edited by
                    #9

                    Dave Kreskowiak wrote:

                    I spewed Coke out my nose

                    Thanks for the mental picture :laugh:

                    Dave Kreskowiak wrote:

                    onto my (work) laptop. Please, don't tell anyone!

                    Oooooooooooooooooh, busted :laugh: Ummm, I didn't see or read anything, boss. I swear :-D

                    "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

                    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