This project is read-only.
1
Vote

Fix for selection from later time to earlier time

description

Change Calendar.DrawTool MouseMove method to the following
 
    public void MouseMove(MouseEventArgs e)
    {
        if (e == null)
            throw new ArgumentNullException("e");
 
        if (e.Button == MouseButtons.Left)
        {
            if (m_SelectionStarted)
            {
                DateTime m_Time = m_DayView.GetTimeAt(e.X, e.Y);
                ////m_Time = m_Time.AddMinutes(30); // Changed
 
                if (m_Time <= m_SelectionStart)
                {
                    m_DayView.SelectionStart = m_Time;
                    m_DayView.SelectionEnd = m_SelectionStart.AddMinutes(30); // Changed
                }
                else
                {
                    m_DayView.SelectionEnd = m_Time.AddMinutes(30); // Changed                    }
 
                m_DayView.Invalidate();
            }
        }
    }

comments