473,396 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

c# MonthCalendar check if date falls in selection

I was wondering if there is an easy way to check if a date falls in a given selection range. I have the selection range already made and I want to be able to take a given date and see if it falls within that range.

Thank you,
-Dean Miller
Mar 15 '07 #1
1 2246
Well I figured out a way to do it but if someone can find an easier way let me know. This is the method I created.

bool found = false;
DateTime test = monthCalendar1.SelectionStart;
for (int i = 0; i < counter; i++)
{
if (test.Date.CompareTo(com.Date) == 0)
found = true;
test = test.AddDays(1);
}
return found;
Mar 15 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Robert Misiak | last post by:
When using a MonthCalendar.DateChanged eventhandler, is there a way a clean way to figure out if the date was changed by the user (as opposed to it being changed programmatically)? Thanks,...
1
by: Trevor | last post by:
When the year in the monthcalendar control is decremented the whole year is selected between the currently select date and the newly chosen date. However this highlighting behavior does not occur...
8
by: vbmark | last post by:
I want the MonthCalendar control to return the single day selected. I have MaxSelectionCount = 1. What I get back though is this: "SelectionRange: Start: 5/5/2005 12:00:00 AM, End: 5/5/2005...
3
by: DS | last post by:
I seem to have stumbled upon something that I can't explain and was wondering if someone else could maybe help me figure out why this happens. I've tried it in both VS2003 and with VS2005b2 and in...
1
by: DS | last post by:
I seem to have run into another strange anomaly with the monthCalendar control. I want to display 6 months at time with either the first half of the year (January-June) or the later half of the...
2
by: meska | last post by:
Hi all, Scenario: I have a MonthCalendar control, and DataGridView. Depending on dates displayed in MonthCalendar I want to update information from database. The Possible Solution: So I...
11
by: Randy | last post by:
I have a MonthCalendar on one of my forms. I have disovered that the DateChanged event is triggered not only when the user clicks on a new date, but also if they click on the Previous or Next...
2
by: SePp | last post by:
Hi there, I have a WindowsForm which includes a label. I want to add a date to this label which a user can select. I thought it is probably the best to open another WindowsForm and to add on...
1
by: Brian S. | last post by:
Hi, I am having a problem with the monthcalendar control. When I allow multi selection of dates.. the dates disappear. How can make them appear and maintain the user selection? Brian
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.