Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. mastermosley

    C# Changing text in textbox

    I am only creating the form once. I'm calling the log procedure from a different thread then the main thread which the text box was created in thats a problem. As you can see by my code if the handle for the text box is created then I should have no problem, how do I create a handle for my text box.
  2. mastermosley

    C# Changing text in textbox

    Ok I think I figured something out here. public void Log(string Text) { string CurTime; Form1 myForm = new Form1(); if (myForm.textBox1.InvokeRequired == true) { MessageBox.Show("TEST"); //We're not in the UI thread, so we need to call BeginInvoke...
  3. mastermosley

    C# Changing text in textbox

    If it was on the same thread then the textbox.text should be changed but its not. thats the problem.
  4. mastermosley

    C# Changing text in textbox

    Ya but I'm calling the code after I do a threadstart so its in a diffrent thread when I call the Log Functions.
  5. mastermosley

    C# Changing text in textbox

    Ok I set up my log function like this: public void Log(string Text) { string CurTime; Form1 myForm = new Form1(); if (myForm.textBox1.InvokeRequired) { myForm.textBox1.BeginInvoke(new StringParameterDelegate(Log), new object[] { Text }); return; }...
  6. mastermosley

    C# Changing text in textbox

    public void button1_Click(object sender, EventArgs e) { ThreadStart job = new ThreadStart(Connection.Start); Thread thread = new Thread(job); thread.Start(); } Calls the procedure Start() which is located in the same class, but using a...
  7. mastermosley

    C# Changing text in textbox

    Yes it is on a diffrent thread is that the problem?. I'm running a constant loop which processes the information taken from telent as this is a telnet server. And it would freeze my main form so I ran it in a diffrent thread.
  8. mastermosley

    C# Changing text in textbox

    Ok I've got a function public void Log(string Text) { string CurrTime; CurrTime = DateTime.Now.ToString("dd/MM/yyyy h:MMtt"); TextOut = "[" + CurrTime + " " + "] " + Text; textBox1.Text = "test" + textBox1.Text + TextOut + "\n"; } its...
  9. mastermosley

    Calling a procedure

    I have public void Procedure() in a class, and I have a form. How do I call the procedure from the form?

Part and Inventory Search

Back
Top