无窗控制 [英] Windowless Controls
问题描述
ShowWithoutActivation
方法的 MSDN 页面 - here - 在 Form
状态下,ToolStripItem
是无窗口的.
The MSDN page for the ShowWithoutActivation
method - here - on a Form
state that ToolStripItem
s are windowless.
控件无窗口意味着什么?他们的目的是什么?如何制作自己的无窗口控件?
What does it mean for a control to be windowless? What purpose do they serve? How can I make my own Windowless controls?
推荐答案
在底层的 Windows 架构中,Control 基本上是一个无边框的 Window.它们 90% 是同一回事.
In underlying Windows architecture, a Control is basically a borderless Window. They are 90% the same thing.
另一方面,ToolStripItem 不是从 Control 派生的.它不绘制自己,它没有窗口句柄或消息队列.ToolStripItem 只是一个用作 ToolStrip 的组织扩展的类.ToolStrip 将许多消息和事件转发到 ToolStripItems.
A ToolStripItem, on the other hand, does not derive from Control. It does not draw itself, it does not have a Window handle or a message queue. A ToolStripItem is just a class that functions as an organizational extension of the ToolStrip. The ToolStrip forwards many messages and events to the ToolStripItems.
这样做的目的是提高性能并提高透明度.
The purpose of this is to improve performance and allow better transparency.
这篇关于无窗控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!