什么是无窗控件? [英] What is a windowless control?

查看:71
本文介绍了什么是无窗控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows中,它们称为无窗口控件。

Under Windows their is something called a Windowless Control.

  • RichEdit

什么是一个无窗口控件,它有什么好处?

What is a Windowless Control and what are its benefits?

推荐答案

无窗口控件是一个对象,它使您无需进行任何操作即可需要您创建一个窗口。

A Windowless control is an object that gives you the behavior of a control without requiring you to create a window.

当您要修改或扩展行为,或者要在创建窗口会很麻烦或困难的地方使用行为时,这很有用。

This is useful when you want to modify or extend the behavior, or when you want to make use of the behavior in places where creating a window would be awkward or difficult.

例如,您要在页面上嵌入数百个丰富的编辑控件,如果它们是每个窗口,则每个控件都必须获得焦点才能获得

Say, for instance, you want to imbed hundreds of rich edit controls on a page, if they were each windows, then each would have to get focus in order to get user input, and each would paint individually, etc.

但是,如果您愿意跟踪无窗控件的位置并进行其他通常需要的整理工作,通过创建一个窗口(例如,路由键盘消息)免费获得,然后使用无窗口控件可以以较低的开销获得更好的结果。

But if you are willing to keep track of the locations of the windowless controls and do some other housekeeping that you would normally get for free by creating a window (i.e. routing keyboard messages), then you can get better results with lower overhead by using windowless controls.

这篇关于什么是无窗控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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