结合2种不同的形式 [英] Combine 2 different forms..

查看:115
本文介绍了结合2种不同的形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个项目
1是仪表,另一个是googlemap.
这两个分别工作良好.
我正在尝试将这2合为1.

i)合并为1形式而不是2.
ii)合并代码. (我尝试过,但是会发生冲突)

拜托,我真的卡住了..我是一个新手,请耐心等待,因为我可能需要逐步进行教学..
如果您能帮助我,我会非常感激.
数百万个谢谢.. =)

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..=)

推荐答案

慢慢来.毕竟,您显然知道如何从头开始以一种形式编写新代码,否则您将无法启动它,对吗?您只需要使用现有的错误"代码,那么您唯一的实际"问题就是如果速度更快,对吗?

首先,不要高估您已经创建的代码.您可以轻松地将其中的一些丢弃.试试这个:

  • 不要以两种现有的形式对您的代码进行洗牌.创建第三种形式,然后将现有代码逐步移到那里.
  • 不要过度使用Designer.您的问题是,由于与Designer绑定,您已经允许太多自动生成的代码,这些代码无法像您自己那样控制.不要重复这个错误:尽量少用可视化编程-只做可视化的事情,基本的布局.其他一切都尝试在代码中进行.
  • 不要理清冲突-避免冲突.从重构开始.使用重构引擎来重命名所有内容以避免冲突. 使用重构引擎.它将允许重命名所有名称,包括自动生成的名称.永远不要使用任何自动生成的名称,例如Form1Label1.这样的名称残酷地违反了(好的)Microsoft命名约定.赋予所有语义名称.
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.


这篇关于结合2种不同的形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆