I will try to help, start by designing your main form. In the Solutions
window, right click on the solution name and click on Add, then Add Windows
Form, and name it popupForm, then add your text box and 2 buttons. Get the
physical stuff out of the way. If you start by just letting the new form be
called default 'form2.vb' then thats fine too
In the button click event to make a new form2, you would create an instance
of the form with a Dim, you get there by double clicking on the button you
created, and inside the routine type the handler, then also for button 2 add
the other handler
keeping in mind Form2 is popupForm
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim dataentry As New popupForm
dataentry.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Me.TextBox1.Text = popupForm.stringarray
End Sub
Yes, technically you could create a sub to handle your new popup forms
creation and whatever, this is for example use
In the form2 or popupForm, create a textbox and a button, double click the
button
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
stringarray = Me.TextBox1.Text.ToString
End Sub
Now, do you want the text in your main form1 to change whenever text in the
other form changes? Thats far more complicated and should be part of a new
upgrade to VB release 3?
Anyhow, to update the first textbox the only way I know of is to use a thing
called an Observer Pattern. The changing data in the textbox triggers an
update event and the form1 textbox has to be subscribed by giving its
address to the event.
If anyone knows another way? Im interested to hear it
"Al_C" <ac****@bicnet.net> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
As mentioned earlier I've been away from coding for about 5 years. Know I
know why :(
I've been trying to work out a critical detail, hard to do on Thanksgiving
;)
Push a button on form1, form2 appears, I enter some text push a button and
get the data back to form1.
In the "old days" we had globals to pass stuff like this through. (as a C
programmer by background
I always found that pretty poor). But now I can't find a mechanism to do
what I want. I've done a lot of MSN and google searching but nothing that
works.
(have to admit, I really need to change my Fileopen and other classic
basic code to .net)
Thanks to all, and hope you had a great day of turkey.