Created
July 8, 2018 05:33
-
-
Save devmnj/0a3491b1e031b1b88ffe379b1ee5ac83 to your computer and use it in GitHub Desktop.
Property Binding C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class Master: Form,INotifyPropertyChanged{ | |
public Master() | |
{ | |
InitializeComponent(); | |
lbl_company.DataBindings.Add("Text", this, "Company"); | |
} | |
private void pictureBox16_Click(object sender, EventArgs e) | |
{ | |
ChildForm c = new ChildForm (); c.MdiParent = this; | |
ac.Show(); | |
} | |
private string foo; | |
public string Company | |
{ | |
set{ | |
foo=value; | |
OnPropertyChanged("Company"); | |
} | |
get { return foo; } | |
} | |
protected virtual void OnPropertyChanged(string property) | |
{ | |
if (PropertyChanged != null) | |
PropertyChanged(this, new PropertyChangedEventArgs(property)); | |
} | |
#region INotifyPropertyChanged Members | |
public event PropertyChangedEventHandler PropertyChanged; | |
#endregion | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment