Solved

How do I clear a selection in monthcalendar in csharp?

Posted on 2014-11-30
2
198 Views
Last Modified: 2014-12-16
After making a selection in monthcalendar and acting on it I wish to remove the highlighting programmatically.  Is there a method for doing so?  I've tried setting it to a non-displayed date but the calendar helpfully scrolls to that month which is not what I want.
0
Comment
Question by:agelders
2 Comments
 
LVL 27

Expert Comment

by:MikeToole
ID: 40474402
A monthcalendar?
What is it, how are you using it, Windows forms, ASP, WPF ????
0
 
LVL 21

Accepted Solution

by:
MogalManic earned 500 total points
ID: 40474638
I am assuming that you are talking about the MonthCalendar control in the System.Windows.Forms namespace.

It looks like you cannot set the selected date range to nothing selected.  The ResetSelectedRange() method sets the selected date to the current date.    You can either use readonly textboxes (have them set by the DateChanged event)

Or use the DateTimePicker control.  This control allows you to set the selectedDate to NULL.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now