有2个窗体form1和form2,form1中有个panel和一个button,panel里有个label,panel的visible初始属性设置为false,form2中有一个textbox和一个button,我想点击form1中button使form2出现,而且form1不关闭,然后用form2中button_click事件使textbox传值给form1中label,然后form2关闭,form1中panel的visible属性变为true。求代码啊。。paneltextboxlabel
解决方案 »
- window service中使用office组件转pdf问题
- .NET Winform 程序死机
- 谁那里有关于xml的所有操作方法,包括排序,增,删,改,查
- List<object>序列化的问题
- 请问使用Microsoft.Office.Interop.Word将图片插入word的时候出现图片总是浮动图片总是浮于文字上方的问题
- 请大家帮我理解一下变量的安全性
- 关于接口,委托,事件...求指点!
- 关于skinEngine的问题
- 两个问题?
- 为什么抽象类/接口 不能创建实例?如果要引用的话,我怎么用这个“抽象类/接口”呢?
- 窗体应用程序 这个效果怎么实现?
- winform窗体如何调用服务器中的类???
2,使用事件;
Form1的
private void button1_Click(object sender, EventArgs e)
{
Form2 fm = new Form2();
if(fm.ShowDialog()==DialogResult.OK)
{
lable1.text =fm.Result
this.panel.visible=true;
}
}
2的:
public string Result {get;set;}
private void button1_Click(object sender, EventArgs e)
{
Result=text1.text;
this.DialogResult=DialogResult.OK;
Close();
}