what i need is when form2 is opened from form1 cliking on a button then on form2 i click on anothe butto and i set the value of a textbox of form1.
if i set the type of application as windows form application it is all ok but if i set as class library i have the error reference to a non-shared member requires an object reference.
if i reference to Dim frm = New form2 it open a second form2 and i dont want it.
how can resolve this?
thank you.
here is the code:
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Form2.ShowDialog()
End Sub
End Class
Public Class Form2
Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Form1.TextBox1.Text = "aaaa"
Me.Close()
End Sub
End Class