(adsbygoogle = window.adsbygoogle || []).push({});
this is pretty basic but it's very useful..
it basically builds up a full custom error list, without defining every message box.
so you want to create a new void, or on a button.. whatever you like.
start of with this..
private void CheckErrors()
{
string Errors = null;
}
this means that at the start 'Errors' wont be defined, basically reset so it can be built again.
now you want to add your custom errors, so something like this..
private void CheckErrors()
{
string Errors = null;
if( textBox1.Text == "" )
{
Errors += "- No Text Inputted!\n";
}
}
make sure you have 'Errors +=', this means it adding to it.. also the '\n' is for a new line after, so it's shown clearer.
Now, you want to do it for everything you want to error.
After stating all the errors you create a part in the void which acts on either if it's Errored or no errors, just like this..
private void CheckErrors()
{
string Errors = null;
if( textBox1.Text == "" )
{
Errors += "- No Text Inputted!\n";
}
if( Errors == null )
{
//YOUR FINAL FUNCTION
}
else
{
MessageBox.Show( "The Following Errors Occured\n" + Errors );
}
}
and thats bascially it, it will give you a full list instead of threading ever error and making a new message box show for each error.
People will already have something like this, but if you dont.. then be sure to use it.