private void CollectionsActionView_Load(object sender, EventArgs e) { List <Web_Menu_Model> result = null; if (controller.getAllCatogary(ref result)) { chlb_catogary.Items.AddRange(result.ToArray()); } chlb_catogary.DisplayMember = "name"; switch (action) { case CollectionsAction.Add: btn_action.Text = "Add"; break; case CollectionsAction.Update: btn_action.Text = "Update"; tb_name.ReadOnly = true; LoadData(); break; case CollectionsAction.Detail: btn_action.Text = "Close"; LoadData(); tb_name.ReadOnly = true; rtb_description.ReadOnly = true; rtb_content.ReadOnly = true; btn_apply.Visible = false; btn_browser.Enabled = false; chlb_catogary.Enabled = false; tb_title.ReadOnly = true; pn_imageattach.IsEnable = false; break; } pn_imageattach.OnImageAttachDeleted += Pn_imageattach_OnImageAttachDeleted; }