PropertyGrid控件(1) 介绍

概要:用过 Visual Studio 里的人,都会熟悉属性窗口 (Properties Window),在 Properties Window 里面,你可以浏览一个对象的所有可浏览属性,如下图。而这个Properties Window 是用微软的 .NET 中的 PropertyGrid 控件 (Control) 做出来。

Introducing the PropertyGrid Control

If you have used Microsoft® Visual Basic® or Microsoft Visual Studio .NET then you have used a property browser to browse, view, and edit the properties of one or more objects. The .NET Framework PropertyGrid control is core to the property browser that is in Visual Studio .NET. The PropertyGrid control displays properties for any object or type, and it retrieves the item's properties, primarily using reflection. (Reflection is a technology that provides type information at run time.)

The following screen shot shows how a PropertyGrid looks when placed on a form.

propertygrid control

Figure 1. PropertyGrid on a form

The PropertyGrid contains the following parts:

  • Properties 属性
  • Expandable Properties 扩展属性
  • Property Category Headings 属性类型
  • Property Descriptions 属性说明,就在PropertyGrid 最下面
  • Property Editors 属性编辑器,比如Boolean类型就显示True/False,日期类型就显示日期编辑器。
  • Property Tabs 就是最上方的按钮,缺省有两个,一个是按字母排序,一个是按类型排序
  • Commands Pane (displays designer verbs that a control's designer exposes)

 


编者或作者: 我有闲    收录日期: 2008-12-21
参考或来源:

上一页: Javascript 得到 Div 的高度 返回上级目录: IT知识文章 下一页: PropertyGrid控件(2) 创建一个PropertyGrid控件


© 2008 woyouxian.net 版权所有 Contact Us