Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I have 2 projects
1 is meter gauge, another is googlemap.
these 2 works well seperately.
i'm trying to combine these 2 into 1.

i) combining into 1 form instead of 2.
ii) combine the codes. (i tried, but it'll clash)

please, i really stuck.. im a newbie, please be patient as i might need teaching in step by step..
i really appreciate if u could help me up..
millions thank..=)
Posted
Comments
Sergey Alexandrovich Kryukov 6-Feb-12 1:51am    
I don't see how a short advice article could help here. You did not report any particular technical problems. So, just to it more thoroughly....

However, I do have just some advice... Please see my answer.
--SA

1 solution

Just go slowly. After all, you apparently know how to write new code from scratch and in one form, otherwise you won't start it, right? You only need to use existing "wrong" code, so your only "real" problem is to do if faster, right?

First of all, don't overvalue your already created code. You can easily throw out some of it out. Try this:

  • Don't shuffle you code in two existing forms. Create third form and gradually move your existing code there.
  • Don't overuse Designer. Your problem is that you already allowed too much auto-generated code which you do not control as well as your own, due to binding with the Designer. Don't repeat this mistake: use the bare minimum of visual programming — do only the visual things, basic layout. Everything else try to do in code.
  • Don't sort out clash — prevent it. Start with refactorization. Use refactoring engine to rename everything to avoid clash. Use refactoring engine. It will allow to rename all names, including auto-generated. Never ever use any of the auto-generated names like Form1 or Label1. Such name brutally violate (good) Microsoft naming conventions. Give everything semantic names.


Good luck,
—SA
 
Share this answer
 
v5
Comments
Sander Rossel 6-Feb-12 2:09am    
My 5. I know lots of people who think "combining" forms, or "refactoring" means copy paste, solve errors by commenting them out and then maybe remove code that's not necessary anymore.
The only correct method is by re-evaluating every line of code and preferably write some new :)
Sergey Alexandrovich Kryukov 6-Feb-12 2:27am    
Thank you, Naerling.

Good point. One my co-worked, ears ago, reasonably noted: "in programming, Paste should be prohibited by a decree". A bit exaggerated but pretty much true...
--SA
Sander Rossel 6-Feb-12 3:40am    
I've got a co-worker who copy/pastes everything. When asked what 'his' code does he answers "I don't know, I just copy/pasted it all!"... I agree with your co-worker 101%. Copy/paste is in many cases an unforgivable programmers sin! :)
Copy/paste is only allowed when you know exactly what you're copying (i.e. you have to own the right to copy/paste).
Espen Harlinn 6-Feb-12 6:36am    
Good reply :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900