无窗口用户控件 [英] Windowless user controls
本文介绍了无窗口用户控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在C#中创建无窗口用户控件?
解决方案
请参阅我对该问题的评论。它应该解释为什么这个问题毫无意义。或者它对于我不知道的库有一定意义,但是这不是.NET FCL的一部分。
我只能推测你的意思类似System.ComponentModel.Component
。组件与控件有些类似,有些与Windows API Windows及其处理程序无关,例如Timer
。您可以创建类似于从Component
派生的类的组件,但这些组件与控件无关,尤其是对于用户控件。
顺便说一下,我自己的观点是,将这些非控制类作为可以与设计人员一起使用的组件是非常愚蠢的。我可以讨论这个问题,如果有人会解释我是一个组件如何帮助使用对话计时器,但到目前为止没有人尝试过。与此同时,我可以解释为什么这很糟糕。我怀疑,唯一的原因是营销。 :-)
新年快乐!
-SA
How to create a windowless user control in C# ?
解决方案
Please see my comment to the question. It should explain why the question makes no sense. Or it makes some sense for the library I don''t know, but then this is not a part of .NET FCL.
I can only speculate that you meant something likeSystem.ComponentModel.Component
. Components are somewhat similar to controls, and some are not related to Windows API Windows and their handlers, such asTimer
. You can create such components as the classes derived fromComponent
, but such components has nothing to do with controls, especially with user controls.
And by the way, my own opinion is that making such non-control classes the components which can be used with the designer was plain stupid. I can discuss this matter if someone will explain me how being a component helps to work with a timer of dialog, but so far no one tried. At the same time, I can explain why it''s bad. I suspect, the only reason for that was marketing. :-)
Happy New Year!
—SA
这篇关于无窗口用户控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文