NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Passing strings from one Form to another in Visual Basic Express 2008?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Reply
 
LinkBack Thread Tools
Old 02-06-2010, 12:14 PM THREAD STARTER               #1 (permalink)
Senior Member
 
FPForum's Avatar
Join Date: Apr 2006
Location: Houston, TX
Posts: 2,795
FPForum has a brilliant futureFPForum has a brilliant futureFPForum has a brilliant futureFPForum has a brilliant futureFPForum has a brilliant futureFPForum has a brilliant futureFPForum has a brilliant futureFPForum has a brilliant futureFPForum has a brilliant futureFPForum has a brilliant futureFPForum has a brilliant future
 



Animal Cruelty Animal Rescue

Passing strings from one Form to another in Visual Basic Express 2008?


I am using a TextBox control on one form to accept a directory name and trying to use it on a second form to find the number of files in that directory

(filecnt = My.Computer.FileSystem.GetFiles(Form1.txtLocallyAr chivedJpg). I receive the following error whenever I try and use the directory entered in the TextBox “Value of type 'System.Windows.Forms.TextBox' cannot be converted to 'String'”

How can I get rid of this error?
FPForum is offline   Reply With Quote
Old 02-06-2010, 05:45 PM   #2 (permalink)
Domains my Dominion
 
sdsinc's Avatar
Join Date: Aug 2005
Location: Web 1.0
Posts: 9,558
sdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatness
 


Third World Education Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Animal Rescue Animal Cruelty AIDS/HIV Animal Rescue Wildlife Breast Cancer Animal Rescue Wildlife
It would be good that you post some code.

Assuming that in the second form you already have a reference set to Form1 you could get the value of the string entered in the textbox like this (in Form2)
Code:
filecnt = Form1.txtDirectory.Text
where txtDirectory is the textbox name
????: NamePros.com http://www.namepros.com/programming/638337-passing-strings-one-form-another-visual.html

A better way would consist in passing the string as a parameter to Form2 using Overload methods.
Example: How To Pass Data Between Forms in VB.NET
__________________
NameNewsletter.com - free lists of available domain names
ZoneFiles.net (beta) - ccTLD and gTLD droplists
sdsinc is offline   Reply With Quote
Old 02-08-2010, 07:15 PM THREAD STARTER               #3 (permalink)
Senior Member
 
FPForum's Avatar
Join Date: Apr 2006
Location: Houston, TX
Posts: 2,795
FPForum has a brilliant futureFPForum has a brilliant futureFPForum has a brilliant futureFPForum has a brilliant futureFPForum has a brilliant futureFPForum has a brilliant futureFPForum has a brilliant futureFPForum has a brilliant futureFPForum has a brilliant futureFPForum has a brilliant futureFPForum has a brilliant future
 



Animal Cruelty Animal Rescue
Got it figured out sds! Thanks
FPForum is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 03:51 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger