Visual Studio的设计师总是试图改变我的控制 [英] Visual Studio Designer is always trying to change my control

查看:185
本文介绍了Visual Studio的设计师总是试图改变我的控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个有点复杂的用户控件,并用它工作时的Visual Studio 2008是给我一个相当无害的烦恼。每一次我打开控制的设计,它决定立即改变一些设计者设定的无害价值观 - 尺寸性能即初始化。如果我保存这些更改,关闭,并重新打开,它几乎总是结束了决定我的控制的另一个组件需要它的初始大小改变,循环往复。幸运的是,这些变化是无害的,因为我使用的是自动调整大小无处不在,但是这是很烦人的工作。我没有从哪里开始搞清楚什么错误的foggiest,我唯一的想法,现在是设计师是分配自动调整大小每次我打开控制时间返回到初始大小字段的结果。关于原因/修复任何想法

I have a somewhat complex UserControl, and Visual Studio 2008 is giving me a rather harmless annoyance when working with it. Every single time I open the control with the Designer, it decides to immediately change some of the harmless values set by the designer - namely the initialization of Size properties. If I save those changes, close, and reopen, it almost invariably ends up deciding another component of my control needs its initial size changed, ad infinitum. Luckily these changes are harmless since I'm using automatic sizing everywhere, but this is quite annoying to work with. I haven't the foggiest on where to start figuring out what's going wrong, my only thought right now is that the Designer is assigning the results of auto-sizing back into the initial size fields every time I open the control. Any ideas on causes/fixes?

编辑:同时,我使用的应用程序设置,以节省整个的运行一定的可调整大小的子组件的尺寸应用程序,但我真的希望设计师是足够聪明,明白,它应该永远只能是使用默认值。

Also, I am using Application Settings to save sizes of certain resizable child components across runs of the application, but I really hope the Designer is smart enough to understand that it should only ever be using the defaults.

推荐答案

也许它可以帮助:搜索
我注意到,FormDesigner(不WPF,没有Web等)有如果你插入一个奇怪的行为一个自定义用户控件。结果
还有其他控件(分组框中,编辑框,组合框)大小的随机变化(对我来说发生与宽度)。结果
的控制选择去调整似乎是随机的,但在整个VS2010的重新启动它始终是相同的。如果删除并重新插入,设计者选择不同的控制做随机调整...
搜索结果我改变了我的用户的财产AutoScaleMode从字体,以继承,并没有再次发生。

Maybe it can help:
I noticed that FormDesigner (no WPF, no Web etc) has a strange behaviour if you insert one custom UserControl.
There is a random change of other controls (GroupBox, EditBox, ComboBox) size (to me happened with width).
The controls choosen to resize seems to be random, but across restarting of vs2010 it is always the same. If deleted and reinserted, the designer chooses a different control do randomly resize...

I changed the property AutoScaleMode of my UserControl from "Font" to "Inherit" and it did not happen again.

这篇关于Visual Studio的设计师总是试图改变我的控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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