Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27243

VS 2005 how to receive value on one from, from another form

$
0
0
Hi. I have a main form on which there is a textbox in which i want to load a value, from another form.

on form1 i.e. frmreceive has two textbox, txtname and txtpassword (both are dummy)

on the gotfocus event of txtpassword (in which i want to load value, from another form) i put the following code

Quote:

frmSending.Show()
when frmsending appears to front, there is a textbox named txtSend and a button btnSend. When i enter the value and click the btnSend so the value goes to a variable (which i have declared in a separate module and then from that module it is being received by the frmReceive.)



the sending form button has the following code.

Quote:

Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click

var1 = txtsend.Text
Me.Hide()

frmreceive.Focus()
End Sub
and the receiver textbox has the following code

Quote:

Private Sub txtpassword_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtpassword.LostFocus

txtpassword.Text = var1
frmSending.Close()

End Sub
My question is that when i send the button on sending form so values does not load in the desired textbox? Please guide me. I hope that this won't be horrible to understand???

Viewing all articles
Browse latest Browse all 27243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>