Here is my scenario:
I have a windows form designed in Visual Studio 2010. The form is quite simple. It has 2 text boxes with FirstName and LastName label. And one Display Button.
I have a class name Friend. This class has a Display() method that simply display the first and lastname in a MessageBox.
Now what I am trying to do is:
I instantiate an object "f1" of class Friend at form1_load(object sender, EventArgs e) method. and On the form Display button Click event, I tried to call the Display() method of friend class using f1 object that I instantiate on Form Load event.
But it gave me the error message " The name f1 doesn't exist in the current context."
Is it possible to do what I am trying to do anyway?
Thank You for your help.