Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 6th, 2005, 03:13 AM
Registered User
 
Join Date: Sep 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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


 
Old September 6th, 2005, 12:58 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Text of Textbox inside Template DarkForce ASP.NET 2.0 Basics 3 September 14th, 2012 07:11 AM
Change Textbox Backcolor for certain records only camehere Access VBA 5 April 28th, 2008 06:28 AM
Change Textbox and have checkbox checked arholly Access VBA 1 August 25th, 2006 10:22 AM
Change the properties of a textbox control? marksartwork ASP.NET 1.0 and 1.1 Basics 7 April 4th, 2006 04:55 PM
How can i change the textbox into a dropdownlist saif44 ASP.NET 2.0 Basics 1 March 5th, 2006 04:20 PM





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