什么是“视觉继承”的游戏状态? [英] What's the state of play with "Visual Inheritance"

查看:165
本文介绍了什么是“视觉继承”的游戏状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个应用程序必须灵活地显示它的主要形式给用户 - 根据用户的不同,表单应该稍微有所不同,可能是一个额外的按钮,或者是其他的细微差别。为了停止编写代码来显式删除或添加控件等,我转向视觉继承来解决问题 - 在我认为是一个整洁,干净和合乎逻辑的OO风格 - 事实证明,一半的时间继承形式很难在VS中渲染自己没有任何理由,等等 - 我感觉开发者和微软在某种程度上避开了Visual Inheritance的实践 - 你能证实这一点,我在这里错过了什么吗?

Regards。

解决方案

我认为他们在2005年或多或少对桌面设计器问题进行了排序。 $ b您是否尝试了通常的元凶?


  • 没有抽象控件类型

  • 没有构造函数参数任何形式

  • 初始化移动到Form_Load而不是Ctor

  • 与usercontrol / form相同的项目中没有控件, / li>
  • 关闭所有文档 - >清理 - >重建

  • 重新启动VS



我似乎认为只要你完成了上述所有工作,大多数情况下都可以工作。

We have an application that has to be flexible in how it displays it's main form to the user - depending on the user, the form should be slightly different, maybe an extra button here or there, or some other nuance. In order to stop writing code to explicitly remove or add controls etc, I turned to visual inheritance to solve the problem - in what I thought was a neat, clean and logical OO style - turns out that half the time inherited forms have a hard time rendering themeselves in VS for no good reason etc - and I get the feeling that developers and to some extent Microsoft have shunned the practice of Visual Inheritance - can you confirm this, am I missing something here?

Regards.

解决方案

I thought they had more or less sorted the desktop designer issues in 2005. Have you tried the usual culprits?

  • No abstract control types
  • No constructor arguments in any form
  • Initialisation moved to Form_Load as opposed to the Ctor
  • No controls in the same project as the usercontrol/form that they are put inside
  • Close all documents -> Clean -> Rebuild
  • Restart VS

I seemed to think that as long as you did all of the above it worked..... mostly.

这篇关于什么是“视觉继承”的游戏状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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