最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
充分利用 .NET 框架的 PropertyGrid 控件(微软)之二
时间:2022-07-02 11:58:31 编辑:袖梨 来源:一聚教程网
                                            创建 PropertyGrid 控件
要使用 Visual Studio .NET 创建 PropertyGrid 控件,需要将该控件添加到工具箱中,因为默认情况下并不包含该控件。在 Tools(工具)菜单中,选择 Customize Toolbox(自定义工具箱)。在对话框中选择 Framework Components(框架组件)选项卡,然后选择 PropertyGrid。
如果您从命令行编译代码,请使用 /reference 选项并指定 System.Windows.Forms.dll。
以下代码显示了如何创建 PropertyGrid 控件并将其添加到窗体中。
' Visual Basic
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 = "选项对话框"
End Sub
End Class
                                        				                
                    
                        
                            
                        
                
                
            要使用 Visual Studio .NET 创建 PropertyGrid 控件,需要将该控件添加到工具箱中,因为默认情况下并不包含该控件。在 Tools(工具)菜单中,选择 Customize Toolbox(自定义工具箱)。在对话框中选择 Framework Components(框架组件)选项卡,然后选择 PropertyGrid。
如果您从命令行编译代码,请使用 /reference 选项并指定 System.Windows.Forms.dll。
以下代码显示了如何创建 PropertyGrid 控件并将其添加到窗体中。
' Visual Basic
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 = "选项对话框"
End Sub
End Class
相关文章
- 暗喻幻想布丽吉塔设施完工时间说明 10-31
- 三国志8重制版居民情感作用介绍说明 10-31
- 三国志8重制版游戏灾害效果介绍说明 10-31
- 三国志8重制版武将不同状态区别说明 10-31
- 三国志8重制版武将阶级提升方法分享 10-31
- 三国志8重制版武将不同阶级作用说明 10-31
 
             
                                 
                                 
                                 
                                 
                                            
                                         
                                            
                                         
                                            
                                         
                                            
                                         
                                            
                                         
                                            
                                         
                                            
                                         
                                            
                                         
                                            
                                        