from1是from的子窗体。我在from1中点击按钮后打开from2,在from3中双击listbox里面的值赋予from1的textbox,如果from1不是new窗体就可以,但现在他属于new子窗体,现在要实现这个功能要怎么做?坐等答案!!!
------解决方案--------------------
最简单的方法,定义一个static变量指向这个new子窗体
*****************************************************************************
签名档: http://feiyun0112.cnblogs.com/
------解决方案--------------------
看我例子中的非模态窗体的实现。
------解决方案--------------------
form2中的textbox1的modifilers设为Public,
private void button1_Click(object sender, EventArgs e)
{
Dim f3 As New Form3
f3.ShowDialog(Me)
}
form3中
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
Dim f1 As Form2 = CType(Me.Owner, Form2)
f1.TextBox1.Text = ListBox1.SelectedItem.ToString()
End Sub