Cross threading..
-
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?
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 <--
-
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 <--
-
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 <--
:wtf:
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
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?
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 -
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 <--
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
-
:wtf:
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Dave 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
-
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
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 -
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, 2008Dave 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