Click here to Skip to main content
15,924,317 members
Home / Discussions / C#
   

C#

 
AnswerRe: Converting C# Projects Pin
Dan Suthar2-Oct-07 21:37
professionalDan Suthar2-Oct-07 21:37 
GeneralRe: Converting C# Projects Pin
WhoisUrBuddy3-Oct-07 2:56
WhoisUrBuddy3-Oct-07 2:56 
AnswerRe: Converting C# Projects Pin
Dan Suthar3-Oct-07 5:53
professionalDan Suthar3-Oct-07 5:53 
QuestionListview header color Pin
warra warra2-Oct-07 4:53
warra warra2-Oct-07 4:53 
AnswerRe: Listview header color Pin
TJoe2-Oct-07 7:31
TJoe2-Oct-07 7:31 
QuestionCan we seperate the functions in different files? Pin
Seraph_summer2-Oct-07 4:10
Seraph_summer2-Oct-07 4:10 
AnswerRe: Can we seperate the functions in different files? Pin
originSH2-Oct-07 4:20
originSH2-Oct-07 4:20 
AnswerRe: Can we seperate the functions in different files? Pin
Pete O'Hanlon2-Oct-07 4:24
mvePete O'Hanlon2-Oct-07 4:24 
You can have the same class split over multiple files (from .NET 2 on), by using the partial keyword. It doesn't matter what the filenames are (before the .cs that is), because the compiler will combine them together.

However, if you have too many functions then this would tend to indicate that there may be a problem with your design. You may be linking too many things together that really should be separated.

Anyway here's a quick example:
FirstFile.cs
public partial class MyClass
{
  // Do something.
}
SecondFile.cs
public partial class MyClass
{
  // Do something else.
}
Interestingly enough, you could create a member in FirstFile.cs and it would be available in SecondFile.cs. This behaviour is visible in the way that Visual Studio.Net breaks up form files.

Deja View - the feeling that you've seen this post before.

AnswerRe: Can we seperate the functions in different files? Pin
Albu Marius2-Oct-07 5:21
Albu Marius2-Oct-07 5:21 
QuestionSave and Print in C# Pin
aammiz2-Oct-07 4:10
aammiz2-Oct-07 4:10 
QuestionCan`t set focus to the form that i show. . . . . Pin
Yanshof2-Oct-07 3:47
Yanshof2-Oct-07 3:47 
AnswerRe: Can`t set focus to the form that i show. . . . . Pin
Andrei Ungureanu2-Oct-07 4:05
Andrei Ungureanu2-Oct-07 4:05 
GeneralRe: Can`t set focus to the form that i show. . . . . Pin
Yanshof2-Oct-07 4:08
Yanshof2-Oct-07 4:08 
QuestionSchema.ini & file names Pin
digsy_2-Oct-07 2:45
digsy_2-Oct-07 2:45 
AnswerRe: Schema.ini & file names Pin
Dave Kreskowiak2-Oct-07 8:48
mveDave Kreskowiak2-Oct-07 8:48 
Questionhow can I change the properties of controls in/from another class [modified] Pin
pramarathe2-Oct-07 2:29
pramarathe2-Oct-07 2:29 
AnswerRe: how can I change the properties of controls on another class Pin
Justin Perez2-Oct-07 2:40
Justin Perez2-Oct-07 2:40 
AnswerRe: how can I change the properties of controls on another class Pin
Pete O'Hanlon2-Oct-07 2:49
mvePete O'Hanlon2-Oct-07 2:49 
AnswerRe: how can I change the properties of controls on another class Pin
Andrei Ungureanu2-Oct-07 2:51
Andrei Ungureanu2-Oct-07 2:51 
AnswerRe: how can I change the properties of controls on another class Pin
pramarathe2-Oct-07 4:37
pramarathe2-Oct-07 4:37 
QuestionSpace Key problem Pin
mihksoft2-Oct-07 1:59
mihksoft2-Oct-07 1:59 
AnswerRe: Space Key problem Pin
Justin Perez2-Oct-07 2:35
Justin Perez2-Oct-07 2:35 
GeneralRe: Space Key problem Pin
mihksoft2-Oct-07 2:37
mihksoft2-Oct-07 2:37 
GeneralRe: Space Key problem Pin
Pete O'Hanlon2-Oct-07 2:39
mvePete O'Hanlon2-Oct-07 2:39 
GeneralRe: Space Key problem Pin
Justin Perez2-Oct-07 2:41
Justin Perez2-Oct-07 2:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.