I am wondering how I can set a button to disable if there is no text inside a text box, but when there is re enable it? Would I put it into a text changed event?
Something like that (WinForms):
private void myTextBox_TextChanged(object sender, EventArgs e) {
myButton.Enabled = !String.IsNullOrEmpty(myTextBox.Text);
}
EDIT: For initial form load you can use Load
event:
private void myForm_Load(object sender, EventArgs e) {
myButton.Enabled = !String.IsNullOrEmpty(myTextBox.Text);
}