概要:如何创建一个PropertyGrid 控件,VB.NET 代码。
To create a PropertyGrid control using Visual Studio .NET, you need to add the PropertyGrid control to the toolbox, since it is not included by default. From the Tools menu, select Customize Toolbox. In the dialog box, select the Framework Components tab and then select PropertyGrid.
If you are compiling your code from the command line, use the /reference option and specify System.Windows.Forms.dll.
The following code demonstrates creating a PropertyGrid control and adding it to a form.
Imports System
Imports System.Drawing
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Globalization Public Class OptionsDialog
Inherits System.Windows.Forms.Form Private OptionsPropertyGrid As System.Windows.Forms.PropertyGrid Public Sub New()
MyBase.New() OptionsPropertyGrid = New PropertyGrid()
OptionsPropertyGrid.Size = New Size(300, 250) Me.Controls.Add(OptionsPropertyGrid)
Me.Text = "Options Dialog"
End Sub
End Class
上一页: PropertyGrid控件(1) 介绍 返回上级目录: IT知识文章 下一页: PropertyGrid控件(3) 使用
© 2008 woyouxian.net 版权所有 Contact Us