السلام عليكم ورحمة الله وبركاته
انا اقوم بتصميم كنترول عبارة عن
calender control
two Radiobuttons للاختيار ما بين التاريخ الهجرى والميلادى
TextBox لعرض التاريخ
عند اختيار التاريخ الهجرى يقوم بتعديل تقويم الكنترول ولكن عند اختيار اى تاريخ يعود الكنترول للتقويم الاصلى ويعرض التاريخ المناظر فى TextBox
الشفرة كلاتى
protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
{
if (cres_rdbtn.Checked == true)
{
GregorianCalendar calendar = new GregorianCalendar();
CultureInfo cinfo = new CultureInfo("en-US");
cinfo.DateTimeFormat.Calendar = calendar;
hijrii_rdbtn.Checked = false;
//Thread.CurrentThread.CurrentCulture = cinfo;
//Thread.CurrentThread.CurrentUICulture = cinfo;
//Page.Culture = cinfo.Name;
//Page.UICulture = cinfo.Name;
//InitializeCulture();
}
}
protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
{
if (hijrii_rdbtn.Checked == true)
{
//GregorianCalendar calendar = new GregorianCalendar();
HijriCalendar cal = new HijriCalendar();
CultureInfo cinfo = new CultureInfo("ar-SA");
cinfo.DateTimeFormat.Calendar = cal;
cres_rdbtn.Checked = false;
Thread.CurrentThread.CurrentCulture = cinfo;
Thread.CurrentThread.CurrentUICulture = cinfo;
//Page.Culture = cinfo.Name;
//Page.UICulture = cinfo.Name ;
//InitializeCulture();
}كيف احافظ على التقويم المختار حتى بعد اختيار تاريخ معين ؟؟
