Home Forums WinForms controls Other WinForms controls WinCalendar CurrentDate

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18275 |

    Any way to display the dotted line around the CurrentDate when the calendar is not focused?

    Imported from legacy forums. Posted by Glenn (had 2169 views)

    User (Old forums)
    Member
    Post count: 23064

    Found the way to do this (code below assumes a bool member var exists called “m_bAlwaysShowFocusRect”):

    protected override void OnPaintDay(Xceed.Editors.PaintDayEventArgs e)
    {
       base.OnPaintDay(e);

       if ((!this.Focused) && m_bAlwaysShowFocusRect)
       {
          if (e.Value == this.CurrentDate)
          {
             System.Windows.Forms.ControlPaint.DrawFocusRectangle(
                e.Graphics, e.ClipRectangle);
          }
       }
    }

    Imported from legacy forums. Posted by Glenn (had 3053 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.