Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Newbie question on using classes
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Newbie question on using classes
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01438397
Message ID:
01438397
Views:
119
Hi,

I created a simple project with one Windows form. Then I added a class (Class1.cs) to this project. In the Class1.cs I created a couple of methods (one method is public).

Then I try to call a method of the class in Class1.cs from Click method of the form. In the Form1.cs I added
using myClass1NameSpace;

But when I enter (in the form button Click() method) something like MyClassName. the intellisense does not show the public method in the class MyClassName. And when I enter this method anyway, I get error "An object reference is required for the nonstatic field, method, or property".

What am I missing?

TIA.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Next
Reply
Map
View

Click here to load this message in the networking platform