Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2005

Tip: Looking for answers? Try searching our database.

transfering info between forms in Visual Basic

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
iwdu15 - 14 Feb 2005 00:21 GMT
How can i transfer information that user inputs from a textbox in one form to
a label in a second form?
Matt Garven - 14 Feb 2005 01:53 GMT
Hi,

When is the second form created? If it's created by the first form in
response to a button click then you probably want something like this:

private void Button1_click(object sender, EventArgs e)
{
   Form2 form2 = new Form2();
   form2.XXX(textBox1.Text);
   form2.Show();
}

and in Form2

public void XXX(string data)
{
   label1.Text = data;
}

Substituting XXX for an appropriate method name. You could also make it a
property, it's up to you. Sorry for the C#, I'm not familiar enough with VB
to be able to write it outside of the IDE.

Hope this helps.

Regards,
Matt Garven

> How can i transfer information that user inputs from a textbox in one form to
> a label in a second form?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.