[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?
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)
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.
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)
Re: Help Calling Added Existing Item
Thank You!
That worked!! :)