473,385 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Thread Not Working

1
Can somone tell me why richtextbox text is not changing?

Expand|Select|Wrap|Line Numbers
  1. public partial class Form1 : Form
  2.     {
  3.         public Form1()
  4.         {
  5.             InitializeComponent();
  6.         }
  7.  
  8.         private void Form1_Load(object sender, EventArgs e)
  9.         {
  10.             Thread t = new Thread(rtb2);
  11.             t.Start();
  12.         }
  13.  
  14.         private void rtb2()
  15.         {
  16.             try
  17.             {
  18.                 richTextBox1.Text = "1";                
  19.             }
  20.             catch(InvalidOperationException ex)
  21.             {
  22.                 MessageBox.Show("HI");
  23.             }            
  24.         }
  25.     }
  26.  
Jan 7 '12 #1
2 1478
GaryTexmo
1,501 Expert 1GB
Can you be a bit more clear as to the problem you're getting? I would have expected an invoke exception, but your thread suggests it's just doing nothing?

Can you please clarify and provide details about the problem?

Thanks!
Jan 9 '12 #2
PsychoCoder
465 Expert Mod 256MB
You need to utilize the TextChanged (http://bit.ly/z1XBEQ) event of the RichTextBox
Jan 10 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Roman Suzi | last post by:
(this is a repost with an addition - probably noone noticed my message first time) Hi! Just to be sure, is email package of Python 2.3 thread-safe or not (to use, for example, in...
6
by: Microsoft News | last post by:
Hi, I have been using several http server code examples from the web, include one from msdn, and I can't seem to get a simple http server thread working. I can connect the server successful...
8
by: jojobar | last post by:
Okay, I am trying to do is to test the webresource in 2.0 1. I created a new project with assembly name (and default assembly name) "Office". 2. I added the following to the AssemblyInfo.cs...
4
by: Bob Day | last post by:
Using VS 2003, VB.net , MSDE .... I am confused by the help example below. In a sub main (whether in a module or winform), do you have to explicitly start the Main_Thread, as they do in this...
3
by: brian_harris | last post by:
I am tring to start a thread where I am passing info into thread. According to MS documentation I must do this by creating a class for that thread. I have done this but am getting a compiler...
12
by: Andrew Bullock | last post by:
Hi, I'm using a second thread within my program to do some long calculations, without locking up the UI: worker = new Thread(new ThreadStart(myClass.Run)); worker.Start(); I want to be...
3
by: Raj Wall | last post by:
Hi, I have an application that uses a number of sub-threads. What is the best way to do some processing in each thread when the main application is shut down? Is the ThreadAbortException...
6
by: HolyShea | last post by:
All, Not sure if this is possible or not - I've created a class which performs an asynchronous operation and provides notification when the operation is complete. I'd like the notification to be...
9
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
I've got a routine that builds a table using different queries, different SQL Tables, and adding custom fields. It takes a while to run (20 - 45 seconds) so I wrote a thread to handle the table...
6
by: Tim Arnold | last post by:
I have a bunch of processes to run and each one needs its own working directory. I'd also like to know when all of the processes are finished. (1) First thought was threads, until I saw that...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.