INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

How to call a public function from one class to another in vb.net

How to call a public function from one class to another in vb.net

How to call a public function from one class to another in vb.net

(OP)
I have the following windows application that contains several public classes. One class if my login screen where a user enters there ID plus password. In this class I have a public function called get_password which verifies the password just entered.

this is an example of the call within my login_screen "lretval = vfp_2007(tempstr2) << where tempstr2 is the text being passed"
with the variable lretval being the return value

I have another class called user_maintenance where a new user id/password/confirm password can be created.

My question is this how can I call the public function found in my login_screen from my user_maintenance screen??

If is already posted here, please point me to the response

thanks in advance

RE: How to call a public function from one class to another in vb.net


Try creating an instance of your Login_Screen class in the User_Maintenance class, then call the function from the Login_Screen instance.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!

RE: How to call a public function from one class to another in vb.net

(OP)
thanks will try it

RE: How to call a public function from one class to another in vb.net

Use the shared modifier then you can use the function without instantiating an instance of the class.
http://www.dotnetperls.com/shared

someVariable = myloginscree.somesharedFunction

RE: How to call a public function from one class to another in vb.net

(OP)
thank you

will try it out

appreciate the help

RE: How to call a public function from one class to another in vb.net

(OP)
Sorry i have not replied earlier

I put the routine into my module and i can now call it from various forms withing the application

forgot all about using the module

again thanks for the replies


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close