//失去焦点时发生 private void TxtProductId_GotFocus(object sender, EventArgs e) { SuperTextbox text = sender as SuperTextbox; //选定文本框中的所有文本 text.SelectAll(); }
private void TxtVip_GotFocus(object sender, EventArgs e) { SuperTextbox txt = sender as SuperTextbox; txt.BackColor = Color.Cyan; txt.SelectAll(); }
private void TxtProductId_LostFocus(object sender, EventArgs e) { SuperTextbox text = sender as SuperTextbox; text.BackColor = Color.Cyan; text.SelectAll(); }
/// <summary> /// 获取焦点时,文本框发生改变 /// </summary> /// <param name="sender">事件的接收者(谁触发事件,这个焦点上的文本框就是谁)</param> /// <param name="e">事件的触发者</param> private void TxtProductId_GotFocus(object sender, EventArgs e) { //实例化自己创建的组件 SuperTextbox text = sender as SuperTextbox; text.BackColor = Color.Pink; text.SelectAll();//选定文本框中的所有文本 }
private void TxtAdmName_GotFocus(object sender, EventArgs e) { //获取组件的内容 SuperTextbox text = sender as SuperTextbox; //选定文本框的内容 text.SelectAll(); }
private void TxtAdmName_GotFocus(object sender, EventArgs e) { SuperTextbox text = sender as SuperTextbox; text.SelectAll(); }