By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,558 Members | 1,673 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,558 IT Pros & Developers. It's quick & easy.

How to split a form when coding?

P: n/a
Hi,

The main form of my project is verbose. It contains 26,000 lines of code and
many controls. These controls are located in three different TabPages of a
TabControl.There are also other tabcontrols on the main tabcontrol.

Is it possible to split a form in coding and then looks like a full well
form to user when excuting?

Thanks in advance

Peter
Feb 14 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
In VS 2005 you can use "Partial Classes" to logically seperate your code.
The IDE uses them to hide the form creation code.

Mike Ober.

"Peter" <zl*****@sina.com> wrote in message
news:us**************@TK2MSFTNGP10.phx.gbl...
Hi,

The main form of my project is verbose. It contains 26,000 lines of code and many controls. These controls are located in three different TabPages of a
TabControl.There are also other tabcontrols on the main tabcontrol.

Is it possible to split a form in coding and then looks like a full well
form to user when excuting?

Thanks in advance

Peter


Feb 14 '06 #2

P: n/a
Thank you, Michael.

Do you think it can also used in UI? e.g. I put some controls on form1,then
I put some other controls on form2. After coding,I want to see all the
controls in one form when excuting.

Peter
Feb 14 '06 #3

P: n/a
CMM
Kinda sorta... but it's not as cool as it could be. It's called Visual
Inheritance (if I remember correctly... nobody really uses it I don't
think).
In your form2 change "Inherits.System.Windows.Forms" (in the code-behind
hidden partial class if you're using VS2005) to "Inherits MyForm1"

Maybe they've improved this in VS2005. I doubt it.

Probably the best solution for your "separation" are UserControls.
UserControls are just containers. You can add a bunch of controls to them.
Then reuse them in as many forms as you want.

--
-C. Moya
www.cmoya.com
"Peter" <zl*****@sina.com> wrote in message
news:eL**************@TK2MSFTNGP14.phx.gbl...
Thank you, Michael.

Do you think it can also used in UI? e.g. I put some controls on
form1,then
I put some other controls on form2. After coding,I want to see all the
controls in one form when excuting.

Peter

Feb 14 '06 #4

P: n/a
Yes, one of my friend also suggested me to use UserControls.

Peter


Feb 15 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.