|
-
Feb 3rd, 2004, 11:28 AM
#1
Thread Starter
Lively Member
Referencing controls from a module
OK, Everyone, please forgive me here. I have searched this site, look at my three books on VB.Net and can not find the answer. This is most certainly an easy task, I just can not figure it out.
What is the proper syntax for referencing a control on a form from a module or class? Example
Form1.Text1.Text = "this text"
This is the old VB6 way, what is the VB.Net way?
Thanks for your help!
-
Feb 3rd, 2004, 12:19 PM
#2
Its exactly the same, you just have to use the reference to the form. If this is something you havent done before then search the forums, as its a hugely popular topic for new .net developers.
As a general help, you shouldnt really have any reason to use modules in this way in .net. They are useful for common funtions and global variables but thats about it.
-
Feb 3rd, 2004, 01:17 PM
#3
Frenzied Member
Grimfort knows a lot more than me. But here's an example:
VB Code:
dim f as new YourFormName
f.txtSomething.text = "Howdy!"
-
Feb 3rd, 2004, 05:20 PM
#4
Fanatic Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|