Click here to Skip to main content
15,885,874 members
Home / Discussions / C#
   

C#

 
GeneralRe: Pausing thread untill asynchronous operation finishes. Pin
pbraun27-Feb-08 9:14
pbraun27-Feb-08 9:14 
GeneralAuto Run Procedures In Windows App Pin
GermanDM26-Feb-08 23:05
GermanDM26-Feb-08 23:05 
GeneralRe: Auto Run Procedures In Windows App Pin
jowecape27-Feb-08 1:07
jowecape27-Feb-08 1:07 
GeneralRe: Auto Run Procedures In Windows App Pin
GermanDM27-Feb-08 1:19
GermanDM27-Feb-08 1:19 
GeneralRe: Auto Run Procedures In Windows App Pin
buchstaben27-Feb-08 1:10
buchstaben27-Feb-08 1:10 
GeneralRe: Auto Run Procedures In Windows App Pin
GermanDM27-Feb-08 1:20
GermanDM27-Feb-08 1:20 
GeneralCross-thread operation not valid: Control 'button1' accessed from a thread other than the thread it was created on. Pin
NarVish26-Feb-08 23:00
NarVish26-Feb-08 23:00 
AnswerRe: Cross-thread operation not valid: Control 'button1' accessed from a thread other than the thread it was created on. Pin
Martin#26-Feb-08 23:11
Martin#26-Feb-08 23:11 
Hello,

As the error message says it all.

Here is a solution using "InvokeRequired" and "Invoke" (google it)
private void threadStartServer()
{
    string result = "";
    TcpListener tcpListener1 = new TcpListener(8080);
    tcpListener1.Start();
 
    EditButtonText("Success");
}
 
private delegate void EditButtonTextDelegate(string strArg);
 
private void EditButtonText(string actText)
{
    if(InvokeRequired)
    {
        Invoke(new EditButtonTextDelegate(EditButtonText), new object[] {actText});
	return;
    }

    button1.Text = actText;
}


Hope it helps!

All the best,

Martin

GeneralRe: Cross-thread operation not valid: Control 'button1' accessed from a thread other than the thread it was created on. Pin
NarVish26-Feb-08 23:36
NarVish26-Feb-08 23:36 
GeneralRe: Cross-thread operation not valid: Control 'button1' accessed from a thread other than the thread it was created on. Pin
N a v a n e e t h26-Feb-08 23:41
N a v a n e e t h26-Feb-08 23:41 
GeneralRe: Cross-thread operation not valid: Control 'button1' accessed from a thread other than the thread it was created on. Pin
NarVish26-Feb-08 23:37
NarVish26-Feb-08 23:37 
GeneralRe: Cross-thread operation not valid: Control 'button1' accessed from a thread other than the thread it was created on. Pin
N a v a n e e t h26-Feb-08 23:25
N a v a n e e t h26-Feb-08 23:25 
GeneralCreating 1D image in C#.NET Pin
D i x y26-Feb-08 22:58
D i x y26-Feb-08 22:58 
GeneralRe: Creating 1D image in C#.NET Pin
Colin Angus Mackay26-Feb-08 23:23
Colin Angus Mackay26-Feb-08 23:23 
JokeRe: Creating 1D image in C#.NET Pin
Malcolm Smart27-Feb-08 2:32
Malcolm Smart27-Feb-08 2:32 
GeneralRe: Creating 1D image in C#.NET Pin
Mark Churchill27-Feb-08 3:04
Mark Churchill27-Feb-08 3:04 
Questionsending a mail using remoting Pin
puneet.priyadarshi26-Feb-08 22:51
puneet.priyadarshi26-Feb-08 22:51 
GeneralRe: sending a mail using remoting Pin
Nouman Bhatti27-Feb-08 1:31
Nouman Bhatti27-Feb-08 1:31 
GeneralDrawToBitmap problem Pin
D i x y26-Feb-08 22:41
D i x y26-Feb-08 22:41 
GeneralRe: DrawToBitmap problem Pin
Guffa26-Feb-08 23:28
Guffa26-Feb-08 23:28 
QuestionHow can i get scanner Serial Number when i am scanning a barcode? [modified] Pin
Vicky2Galaxy26-Feb-08 22:19
Vicky2Galaxy26-Feb-08 22:19 
AnswerRe: How can i get scanner Serial Number when i am scanning a barcode? Pin
DaveyM6927-Feb-08 1:00
professionalDaveyM6927-Feb-08 1:00 
GeneralRe: How can i get scanner Serial Number when i am scanning a barcode? Pin
Vicky2Galaxy27-Feb-08 1:17
Vicky2Galaxy27-Feb-08 1:17 
GeneralRe: How can i get scanner Serial Number when i am scanning a barcode? Pin
DaveyM6927-Feb-08 5:40
professionalDaveyM6927-Feb-08 5:40 
GeneralChange Backcolor of particular cell in dataGridview Pin
M Riaz Bashir26-Feb-08 22:18
M Riaz Bashir26-Feb-08 22:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.