I made this statement to check if TextBox is empty, but the MessageBox always shows up wether the TextBox is empty or not.
private void NextButton_Click
Try doing the following
if (String.IsNullOrEmpty(MaterialTextBox.Text) || String.IsNullOrWhiteSpace(MaterialTextBox.Text)) { //do job } else { MessageBox.Show("Please enter correct path"); }
Hope it helps