在运行时中使用“属性窗口"来自定义窗口表单控件 [英] Using Properties Window in runtime to customize windows form controls
问题描述
是否可以在运行时使用Visual Studio设计时的属性窗口
来自定义特定的 Control
,例如 DataGridView
?>
下面的图片需要使用户能够通过更改控件的属性来自定义 Form
上的控件.
Is there a way to use visual studio design-time Properties Window
at runtime to customize a specific Control
such as DataGridView
?
Some thing like image below needed to enable user to customize controls on a Form
by changing properties of them.
The PropertyGrid is a standard control. You can add one to your Form or create it at run-time.
In the ToolBox, it's usually found in the All Windows Forms
cathegory, or using the search tool.
It can be fully customized and supports transparent colors.
You can use the SelectedObject property to associate it to an existing control and it will populate automatically (this property can also be set at design-time).
The PropertyGrid
can then be used to change the associated control's properties at run-time.
propertyGrid1.SelectedObject = this.dataGridView1;
这篇关于在运行时中使用“属性窗口"来自定义窗口表单控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!