* UIEditForm: 修改代码生成表单,AddText的默认值为null出错

This commit is contained in:
Sunny 2021-05-20 13:16:48 +08:00
parent 084e44d691
commit e11c3d835f
6 changed files with 3 additions and 3 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -57,7 +57,7 @@ namespace Sunny.UI.Demo.Forms
UIEditOption option = new UIEditOption();
option.AutoLabelWidth = true;
option.Text = "增加";
option.AddText("Name", "姓名", "", true);
option.AddText("Name", "姓名", null, true);
option.AddInteger("Age", "年龄", 16);
option.AddDate("Birthday", "生日", DateTime.Now);
option.AddCombobox("Sex", "性别", sex, 1, true, true);

View File

@ -86,7 +86,7 @@ namespace Sunny.UI
edit.Left = option.LabelWidth;
edit.Width = option.ValueWidth;
edit.Top = top;
edit.Text = info.Value.ToString();
edit.Text = info.Value?.ToString();
edit.Parent = this;
edit.Name = "Edit_" + info.DataPropertyName;
edit.EnterAsTab = true;
@ -100,7 +100,7 @@ namespace Sunny.UI
edit.Left = option.LabelWidth;
edit.Width = option.ValueWidth;
edit.Top = top;
edit.Text = info.Value.ToString();
edit.Text = info.Value?.ToString();
edit.Parent = this;
edit.PasswordChar = '*';
edit.Name = "Edit_" + info.DataPropertyName;