【发布时间】:2014-10-08 01:23:23
【问题描述】:
我想更改控件的一些属性。 我不知道该怎么解释。所以让我用一段sn-p的代码来解释一下:
foreach (Control control in Controls)
{
if (control.GetType() == typeof(DateTimePicker))
{
(control as DateTimePicker).Format = DateTimePickerFormat.Custom;
(control as DateTimePicker).CustomFormat = "dd.MM.yy | HH:mm";
}
if (control.GetType() == typeof(Panel))
{
foreach (Control subControl in control.Controls)
{
subControl.Name = control.Name + subControl.Name;
}
}
if (control.GetType() == typeof(Label))
{
control.Name = LabelNameCreate(control.Text);
}
}
会有更多这样的变化,但是我该如何保存这些?
我想运行代码,然后我的项目将采用 new 的形式。
是否有任何方法或组件可以创建用于运行表单的 Designer.cs?
【问题讨论】:
标签: c# visual-studio designer windows-forms-designer