开发者

Visual Studio Designer and Toolbox Confusion

If you create a Windows Service project, a "Service1" class is made for you which has a designer window. Easily 99% of the controls in the Toolbox are unusable in the context of a Windows service, and yet the designer will happily allow things like GUI controls to be dragged and dropped to the designer surface for the service.

Really? REALLY??

This has been the reality of Visual Studio, going back a few versions, but I've never understood why MS seems uninterested or unaware regarding this oddity.

But it occurs to me, perhaps there is a rationale of why MS would intentionally keep it this way, and I'm missing the boat. Please explain? Or perhaps I simply have a m开发者_如何转开发isconfigured VS IDE dev environment, and it works on everyone else's machine. If so, how do I fix it?

Certainly this does not prevent me from getting my work done, but it can hinder learning efforts or hinder speed of browsing relevant "actually usable" components "for the current designer canvas."

Yes I am aware that sections of the toolbox can be manually collapsed, but that answer doesn't cut it. Tools as powerful as .net and VS should be capable of determining "which tools are relevant for the current design canvas." Perhaps there is a plugin that does this selection for me?

Curious about all this...


I think the problem is that the design canvas for services allows the dropping fo components, which are a superclass of controls. Thus, any control is a component, thus any control can be dropped onto it.

Sure, the IDE could test to see if it also supported a Control interface, but the control might be written to detect if a GUI was supported and act as just a control in such situations. Thus, there would be no way for the IDE to know what the control can auto-detect.

The only way to make this work would be to force an arbitrary interface that the component would support, and that seems silly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜