mastermosley
Programmer
Ok I've got a function
its in the same class as the form. I have an on click button event call the procedure like so in the same class as well:
this works sucesfully and puts the values into the textbox, but when I call it from a diffrent class it doesnt work. I set it up: Form1 Form1 = new Form1(); to make reference and it appears in the IDE menu thingy.
so I use
I no the call is working because if I use:
the messagebox pops up with the Log but nothing is typed to the textbox. What is going on am I not making reference to something? Note that the log function is in the same class as the form so I don't need to make reference to the textbox1.text. And it is set to public.
Code:
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 in the same class as the form. I have an on click button event call the procedure like so in the same class as well:
Code:
public void button1_Click(object sender, EventArgs e)
{
Log("test");
}
so I use
Code:
Aleme.Form1 Form1 = new Aleme.Form1();
Form1.Log("Test");
I no the call is working because if I use:
Code:
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";
[b]MessageBox.Show(TextOut); //ADDED THIS[/b]
}