473,405 Members | 2,185 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,405 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 2561
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.