Sending variables from form to another

Reply

Join Date: Apr 2008
Posts: 38
Reputation: q8_dreamy is an unknown quantity at this point 
Solved Threads: 0
q8_dreamy q8_dreamy is offline Offline
Light Poster

Sending variables from form to another

 
0
  #1
Oct 29th, 2008
Hiiiiiiiiii

can any one help me plz

i want to send date and another variables from form to another when click btn... how can i do it?????
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 88
Reputation: Renukavani is an unknown quantity at this point 
Solved Threads: 11
Renukavani Renukavani is offline Offline
Junior Poster in Training

Re: Sending variables from form to another

 
0
  #2
Oct 29th, 2008
hi
in form1 -button click event write it as
Dim frm2 As New Form2(DateTime.Now, "hai")
frm2.Show()
and in 2nd form
Private dt1 As DateTime
Private str As String
Public Sub New(ByVal dt2 As DateTime, ByVal strname As String)
InitializeComponent()
dt1 = dt2
'str = strname;
textBox1.Text = strname
End Sub
it wil work.

if its working mark as PROBLEM SOLVED
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 4
Reputation: himanshu.tomar is an unknown quantity at this point 
Solved Threads: 0
himanshu.tomar himanshu.tomar is offline Offline
Newbie Poster

Re: Sending variables from form to another

 
0
  #3
Nov 1st, 2008
Hi There,
For your problem you can do the following::

In Form1 do::
public shared variable1 as datetime
'get the value from any event as per your program
Form2.date1=variable1
' then in the second form declare variable as
public shared date1 as datetime=Form1.variable

hope that this will help you.

Himanshu
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 1628 | Replies: 2
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC