j*****o 发帖数: 320 | 1 Windows Application with one form. There is a textBox1 and a button
on it.
...
private TextBox getTextBox()
{
TextBox txtBox = new TextBox();
txtBox.Text = DateTime.Now.ToString();
return txtBox;
}
private void button1_Click(object sender, System.EventArgs e)
{
textBox1 = getTextBox();
}
...
Why textBox1.Te |
j**y 发帖数: 1 | 2 Try this,
private void button1_Click(object sender, System.EventArgs e)
{
textBox1.Text = DateTime.Now.ToString();
}
Don't think you can return an object to textBox1
e)
happen?
【在 j*****o 的大作中提到】![](/moin_static193/solenoid/img/up.png) : Windows Application with one form. There is a textBox1 and a button : on it. : ... : private TextBox getTextBox() : { : TextBox txtBox = new TextBox(); : txtBox.Text = DateTime.Now.ToString(); : return txtBox; : } : private void button1_Click(object sender, System.EventArgs e)
|
s***h 发帖数: 88 | 3 Try this:
private void button1_Click(object sender, System.EventArgs e)
{
textBox1.Text = getTextBox().Text;
}
e)
happen?
【在 j*****o 的大作中提到】![](/moin_static193/solenoid/img/up.png) : Windows Application with one form. There is a textBox1 and a button : on it. : ... : private TextBox getTextBox() : { : TextBox txtBox = new TextBox(); : txtBox.Text = DateTime.Now.ToString(); : return txtBox; : } : private void button1_Click(object sender, System.EventArgs e)
|
G**T 发帖数: 388 | 4
maybe you need:
txtBox.refresh
e)
happen?
【在 j*****o 的大作中提到】![](/moin_static193/solenoid/img/up.png) : Windows Application with one form. There is a textBox1 and a button : on it. : ... : private TextBox getTextBox() : { : TextBox txtBox = new TextBox(); : txtBox.Text = DateTime.Now.ToString(); : return txtBox; : } : private void button1_Click(object sender, System.EventArgs e)
|