Hey everyone,

can someone tell me how to include other .cs files in my program? sort of like the .h files in C++ I guess. I want to be able to call functions from other .cs files.

Thanks

Recommended Answers

All 5 Replies

You add them in your projects, the classes then become available.

Just add current form (.cs file) into your project then you can use function on that form.

If its in a different name space you would need to add a using at the top, otherwise no.

Thanks for the replies, i was also stuck at the same thing!!

Another .cs file is definitly not the same as a .h file in C++.
You don't have to include using System; in your code, but then you have to write something like System.Console.WriteLine instead of Console.WriteLine.

commented: Good thinking!! +1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.