hi..how do you use partial classes and methods?

Recommended Answers

Link (google does wonders for answering homework problems)

Jump to Post

All 2 Replies

Link (google does wonders for answering homework problems)

With normal C# classes, you cannot declare a class in two separate files in the same project. But with the partial modifier, you can. This is useful if one file is commonly edited and the other is machine-generated or rarely edited. Partial classes can simplify certain C# programming situations. They are often used in Visual Studio when creating Windows Forms programs. The machine-generated C# code is separate.

Note:Partial classes are sometimes used to separate commonly-edited code from rarely-edited code.

And:This can reduce confusion and the possibility that code that isn't supposed to be edited is changed.

Be a part of the DaniWeb community

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