【发布时间】:2013-05-09 21:34:05
【问题描述】:
我通过工具条打开一个附加表单以输入主窗体中需要的用户名(并在主窗体中声明为字符串)
主窗体代码:
private void toolStripButton6_Click(object sender, EventArgs e)
{
using (Form frm = new Form3())
{
frm.FormBorderStyle = FormBorderStyle.FixedDialog;
frm.StartPosition = FormStartPosition.CenterParent;
if (frm.ShowDialog() == DialogResult.OK)
{
Username = frm.ReturnValue1;
}
}
}
Form3代码:
public string ReturnValue1 {
get
{
return textBox1.Text;
}
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
C# 告诉我没有 frm.ReturnValue1 :(
【问题讨论】:
标签: c# .net forms variables toolstrip