Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ExTextBox : TextBox, INotifyPropertyChanged
- {
- /// <summary>
- /// Gets whether the control contains text
- /// </summary>
- //[Browsable(false)]
- [Bindable(true)]
- public bool HasText
- {
- get { return TextLength > 0; }
- }
- protected override void OnTextChanged(EventArgs e)
- {
- base.OnTextChanged(e);
- OnPropertyChanged("HasText");
- }
- public event PropertyChangedEventHandler PropertyChanged;
- protected void OnPropertyChanged(string propertyName)
- {
- if (PropertyChanged != null)
- {
- var args = new PropertyChangedEventArgs(propertyName);
- PropertyChanged(this, args);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment