标签:style blog http color io os 使用 ar sp
关键代码:
public static void AddDeleteButton(this LookUpEdit lue, string prompttext) { prompttext = string.IsNullOrEmpty(prompttext) ? "删除选中项" : prompttext; lue.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton( ButtonPredefines.Delete, "删除", -1, true, true, false, ImageLocation.MiddleCenter, null, new KeyShortcut(Keys.Delete), new SerializableAppearanceObject(), prompttext, "Delete", null, true) }); lue.ButtonClick += new ButtonPressedEventHandler(lue_ButtonClick); } static void lue_ButtonClick(object sender, ButtonPressedEventArgs e) { if (e.Button.Kind == ButtonPredefines.Delete) { LookUpEdit _curLue = sender as LookUpEdit; _curLue.EditValue = null; } }
使用示例:
this.lookUpEdit1.BindWithAutoCompletion(PersonList, "Name", "Name", "输入需要搜索的...."); this.lookUpEdit1.AddDeleteButton("删除选中数据....");
使用效果:
希望有所帮助!
标签:style blog http color io os 使用 ar sp
原文地址:http://www.cnblogs.com/Yan-Zhiwei/p/4024744.html