private void btnAddGUID_Click(object sender, EventArgs e)
{
bool ok2Create = true;
Guid iid = Guid.NewGuid();
if (edtUUID.Value != null)
{
ok2Create =
DialogResult.Yes == MessageBox.Show(@"Create a new UUID overwriting the existing one?",
@"Overwrite UUID",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
}
if (ok2Create)
{
edtUUID.Value = iid.ToString().ToUpper();
errorProvider.SetError(edtUUID, ""); //Clear any error that may be on the control
}
}