private void jalali2gregory_Click(object sender, EventArgs e)
{
int persyear = int.Parse(txtyear.Text);
int persmonth = int.Parse(txtmonth.Text);
int persday = int.Parse(txtday.Text);
try
{
PersianCalendar persian = new PersianCalendar();
DateTime date = new DateTime(persyear, persmonth, persday,
00, 00, 00, 00, persian);
textBox3.Text = date.ToLongDateString();
}
catch (Exception ex)
{
// loop through the inner exceptions...
while (ex.InnerException != null)
ex = ex.InnerException;
// report the problem...
//MessageBox.Show("استثنائی رخ داده است\n" + ex.Message);
MessageBox.Show("!!!!چنین تاریخی وجود ندارد" + "\n" + ex.Message,"!!!هشدار", MessageBoxButtons.OK,
MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.RightAlign);
}
}