473,378 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How to split <form1.cs> into multiple files?

Hi,
I have a form that has many controls and related actions. My <form.cs> file has crossed 13,500 lines of code. It takes quite a long to load the form or .cs file. I want to divide into small portions. I am thinking of dividing it module-wise. I want to write the event handling functions of a specific module in another file. Is that possible? Can we write the event handler in another file?

Is there any better way to handle this situation?

Thanks

Jul 21 '05 #1
6 2559
I think the only way is using partial classes, a feature that will be
available in the next release of C#.
In the meantime, remember not to include application logic in event
handlers.
Jul 21 '05 #2
I think the only way is using partial classes, a feature that will be
available in the next release of C#.
In the meantime, remember not to include application logic in event
handlers.
Jul 21 '05 #3
what <form1.cs> is?
Jul 21 '05 #4
what <form1.cs> is?
Jul 21 '05 #5
for example you can split your class in a base class(form1_base), which implements only the UI Controls. the next class(form1_eh), which is derived from the form1_base, implements the eventhandler. the next class, which is derived from the form1_eh, implements other function, and so on

Jul 21 '05 #6
for example you can split your class in a base class(form1_base), which implements only the UI Controls. the next class(form1_eh), which is derived from the form1_base, implements the eventhandler. the next class, which is derived from the form1_eh, implements other function, and so on

Jul 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sacalul | last post by:
A simple way to split your file: - create a class BasicClient.cs: using System; namespace Test { public abstract class BasicClass{ public BasicClass(){} public abstract string DoClient();...
4
by: Heinz Zimmermann | last post by:
Hello, is it (in c#) possible, to splitt a large class into two or more files ? If yes, how can I do that ? Thanks Heinz
8
by: Tom | last post by:
Hi I have an aspx page which has javascript to configure xmldata. I added breakpoint to the button method. When I click submit button, it did not go to those breakpoint and show the following...
6
by: Srinivas Kadiyala | last post by:
Hi, I have a form that has many controls and related actions. My <form.cs> file has crossed 13,500 lines of code. It takes quite a long to load the form or .cs file. I want to divide into small...
7
by: Maxwell2006 | last post by:
Hi, Typically partial classes consist of two .cs files. Can I have them in 3 source file? Thank you,
2
by: Dave | last post by:
We have a web app that has some data access code that will need to be used by another process that will load data into the database from behind the scenes. How can I "extract" just this piece of...
9
by: TheSteph | last post by:
In VS 2005 Form files are in 3 parts : From1.cs, Form1.Designer.cs and Form1.resx. In VS 2003 there is only one ".cs files". How can I split my old VS2003 ".cs files" files in 2 files :...
8
by: Mike | last post by:
Is it possible to do this in the HTML of the aspx page? <#% if Eval("Name") != null %> write something here <#% else %> show message for missing name <#% end if %> when I try this I get...
5
by: Steven | last post by:
I have the following in my web.config: <system.web> <profile defaultProvider="MyASPSqlProfileProvider" enabled="true" > <properties> <add name="FirstName" defaultValue="" type="string"/> <add...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.