p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Beginning VB 6 (http://p2p.wrox.com/forumdisplay.php?f=75)
-   -   How to change text in textbox from sub in module (http://p2p.wrox.com/showthread.php?t=33149)

jano59 September 6th, 2005 03:13 AM

How to change text in textbox from sub in module
 
In earlier Vb you could change for example text in a textbox from a sub in a module by
<Form1.Text1.Text="whatever"> How do I do this in Visual Basic.Net

Jan



marcostraf September 6th, 2005 12:58 PM

In VB.NET, the controls are private elements of the form (finally!)
You have to pass the text box control explicitely to the sub, or you can add a property to Form1 that exposes the textBox you want to change (but that is a bad code design, that .NET is trying to discorage)

BTW this is a 'prior .net' forum, I suggest you to switch to a .net forum

Marco


All times are GMT -4. The time now is 12:16 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.