private void DrawToday(Graphics gr, PersianDate curDate) { if (this.showToday) { string date = curDate.ToString("DD dd NM yyyy"); SizeF textSize = gr.MeasureString(date, this.Font); RectangleF rect = new RectangleF(bodyPanel.Width - (textSize.Width + 8), bodyPanel.Height - textSize.Height - 7, textSize.Width + 5, textSize.Height); RectangleF emptyRect = rect; emptyRect.X -= 150; emptyRect.Width += 150; gr.FillRectangle(Brushes.White, emptyRect); gr.DrawString(date, this.Font, brush, rect, sf); } }
// Summary: // Initializes a new instance of the H128Controls.PersianMonthCalendar class. public PersianMonthCalendar() { InitializeComponent(); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.Selectable, true); sf.Alignment = StringAlignment.Center; persianValue = PersianDate.Now; todayLink.Text = persianValue.ToString("امروز: DD dd NM yyyy"); todayLink.Tag = persianValue; markDateList = new List <PersianDate>(); FillCells(persianValue); }