|
-
Oct 16th, 2002, 09:13 AM
#1
Thread Starter
Member
using modules in vb.net
I have my main program that will use a lot of functions so i wanted to put them all in a module. But i want the functions in the module to be able to interact with the objects on the form(i.e. command buttons)
How do i do this?
thanks
-------------------------------
StupidMonkee
-
Oct 16th, 2002, 09:36 AM
#2
PowerPoster
Create public methods in the module and call them from your
form(s) just as you would call any other method.
-
Oct 16th, 2002, 09:48 AM
#3
Thread Starter
Member
But i want the functions in the module to be able to interact with the objects on the form(i.e. command buttons)
right now i can't get them to do that.
-------------------------------
StupidMonkee
-
Oct 16th, 2002, 09:50 AM
#4
Fanatic Member
Have you declared them as Public??
-
Oct 16th, 2002, 09:55 AM
#5
pass the controls you need as parameters to the routine.
-
Oct 16th, 2002, 10:01 AM
#6
Thread Starter
Member
I have made them public and i tried passing them. I can't seem to pass the right object(s). or maybe i am not declaring them right.
anyone got a bit of code to show?
-------------------------------
StupidMonkee
-
Oct 16th, 2002, 10:17 AM
#7
Frenzied Member
You can do what Cander said or you can pass the form in.
Dont gain the world and lose your soul
-
Oct 16th, 2002, 10:30 AM
#8
Thread Starter
Member
It is nto letting me pass the controls or the form. Can some one give me an example since my intuative responses are not seeming to work. I tried passing me. but what do i make it in the fucntion declaration? Object? tried that.
I want to pass 4 command buittons in order to .enable = true them
-------------------------------
StupidMonkee
-
Oct 16th, 2002, 10:31 AM
#9
-
Oct 16th, 2002, 10:39 AM
#10
Thread Starter
Member
That helps tremedoulsy and has the code xamples i needed.
thanks guys and if i still have problems i will shout back
-------------------------------
StupidMonkee
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
|