-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: saileshsaha
Message 3 in Discussion
Hi Kiri, You can access controls from other windows form. My Assumptions:
Two Forms
Form1 --- Form with a button Button1 that shows another Form (Form2)
Form2 --- another Form which has a textbox1 control with a proprty Modifier = Public
you need to have the Modifier property = Public for the TextBox1 in the Form2 if you
want to access it from another form
here i am doing only the Form1 's Button1_Click Code
Dim frm2 As Form2 'Declare that in the declaration section of Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
'these following 3 checks will ensure that you will get the same instance
If frm2 Is Nothing Then
frm2 = New Form2()
frm2.Show()
ElseIf (frm2.IsDisposed) Then
frm2.Show()
frm2 = New Form2()
Else
frm2.Select()
End If
MessageBox.Show(frm2.TextBox1.Text) ' read the text from textBox1 of Form2
frm2.TextBox1.Text = "Any Text" 'change that text in Form2
End Sub
Hope this helps. Regards, Sailesh
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]