Textboxs binding to member variables
C#
3
Posts
2
Posters
0
Views
1
Watching
-
Hi all, is there any way that we can bind Textboxes to a member varaible data for display , like we do in MFC ? if so pls advice.
Public form properties and DataBindings ...
public partial class Form1 : Form {
public string TheMember { get; set; } private TextBox \_textBox; public Form1() { InitializeComponent(); TheMember = "Hello"; \_textBox = new TextBox(); \_textBox.DataBindings.Add( "Text", this, "TheMember" ); this.Controls.Add( \_textBox ); }
}
-
Public form properties and DataBindings ...
public partial class Form1 : Form {
public string TheMember { get; set; } private TextBox \_textBox; public Form1() { InitializeComponent(); TheMember = "Hello"; \_textBox = new TextBox(); \_textBox.DataBindings.Add( "Text", this, "TheMember" ); this.Controls.Add( \_textBox ); }
}