Results 1 to 5 of 5

Thread: [RESOLVED] Help Calling Added Existing Item

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2008
    Posts
    159

    Resolved [RESOLVED] Help Calling Added Existing Item

    I took a .vb file and imported it into my project which is supposed to encrypt and decrypt a users password. I am trying to call this from my main form inside a button and I am having trouble with it.

    I have a function in there that I need to call and take the input from textbox1 and then either encrypt it or decrypt it and display that in textbox 2 but I can't figure out how to do that.

    Here is what I'm doing now...

    TextBox2.Text = TextBox1.Text(Namespace.Function)

    That is not working so that can't be it. I did this once before and it worked but I can't remember how I did it.

    Any advice guys?

  2. #2
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    Re: Help Calling Added Existing Item

    it would be better if you can post your Encrypt and Decrypt function as it will help us to know what parameter it accepts. apart from that normally you call function like this:

    Code:
    TextBox2.Text = Namespace.ClassName.FunctionName(TextBox1.Text)
    __________________
    Rate the posts that helped you

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2008
    Posts
    159

    Re: Help Calling Added Existing Item

    I tried that and here is what I'm getting.

    Code:
    Reference to a non-shared member requires an object reference.

  4. #4
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    Re: Help Calling Added Existing Item

    As per above exception you first need to create a new instance of your class and than call this method.for e.g.
    Code:
    dim objClass as new Namespace.ClassName()
    TextBox2.Text = objClass.FunctionName(TextBox1.Text)
    __________________
    Rate the posts that helped you

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 2008
    Posts
    159

    Re: Help Calling Added Existing Item

    Thank You!

    That worked!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width