public FormItem(ItemFormState pState) { InitializeComponent(); FState = pState; BuildStateList(); ApplyCaption(); FItem = null; }
public ItemForm(object obj, ItemFormState state = ItemFormState.Edit) { InitializeComponent(); item = (CommandItem)(obj); this.textBox1.Text = item.CommandName; this.textBox2.Text = item.Description; this.textBox3.Text = item.DelayMicroSeconds.ToString(); this.textBox4.Text = item.Order.ToString(); if (state == ItemFormState.Edit) { this.Text = "编辑"; } else if (state == ItemFormState.Add) { this.Text = "新增"; } }