473,804 Members | 2,998 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MonthCalendar control - get number of selected days?

How can I get the number of selected days in the calendar? There are
properties for selectionstart, selectionend and also a selectionrange, but
nothing about count. I'd expect the selectionrange to have a count
sub-property, but it doesn't seem to.
James.
Jun 20 '06 #1
3 3998

james wrote:
How can I get the number of selected days in the calendar? There are
properties for selectionstart, selectionend and also a selectionrange, but
nothing about count. I'd expect the selectionrange to have a count
sub-property, but it doesn't seem to.


Dim sr As SelectionRange = MyMonthCalendar .SelectionRange
Dim numDays As Integer = sr.End.Subtract (sr.Start).Days + 1
--
Larry Lard
Replies to group please

Jun 20 '06 #2

Larry Lard wrote:
james wrote:
How can I get the number of selected days in the calendar? There are
properties for selectionstart, selectionend and also a selectionrange, but
nothing about count. I'd expect the selectionrange to have a count
sub-property, but it doesn't seem to.


Dim sr As SelectionRange = MyMonthCalendar .SelectionRange
Dim numDays As Integer = sr.End.Subtract (sr.Start).Days + 1


Must... remember... to check... which... group... replying to...

SelectionRange sr = MyMonthCalendar .SelectionRange ;
int numDays = sr.End.Subtract (sr.Start).Days + 1;

--
Larry Lard
Replies to group please

Jun 20 '06 #3

"Larry Lard" <la*******@hotm ail.com> wrote in message
news:11******** **************@ u72g2000cwu.goo glegroups.com.. .

Larry Lard wrote:
james wrote:
> How can I get the number of selected days in the calendar? There are
> properties for selectionstart, selectionend and also a selectionrange,
> but
> nothing about count. I'd expect the selectionrange to have a count
> sub-property, but it doesn't seem to.


Dim sr As SelectionRange = MyMonthCalendar .SelectionRange
Dim numDays As Integer = sr.End.Subtract (sr.Start).Days + 1


Must... remember... to check... which... group... replying to...

SelectionRange sr = MyMonthCalendar .SelectionRange ;
int numDays = sr.End.Subtract (sr.Start).Days + 1;


Thankyou - worked a treat!
James
Jun 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
3900
by: Ty Smith via AccessMonster.com | last post by:
I noticed that the week numbers in Stephan Leban's MonthCalendar are not consistent with Microsoft Outlook (they are shifted one week forward). Is there any way I can sync these two up by changing something in the module or the code in Stephan's MonthCalendar? Thanks, TySmith -- Message posted via http://www.accessmonster.com
3
14264
by: michael_hk | last post by:
Hi, I am new to Windows Form programming and now have a simple Q about MonthCalendar. I want to hightlight some days in the calendar by changing the background color of these days. But I can't find any property or method that let me do this. What I know is that I can bold them... Thanks.
0
1925
by: Chris Millar | last post by:
I have a user control that i wish to extend to change the date when the user selects the numeric up down button. The code explains itself, hope someone can help. any ideas appreaciated.. Chris. code :
13
3551
by: Sand | last post by:
I have a monthCalender that I want users to be able to select a range of dates (or a single date) then calculate a value based on the number of days that person has selected. The values are higher for the weekends so I need to be able to figure out how many of the selected days are weekdays versus weekends. I already have code to tell me the number of days the person has selected. I also understand how to get the DayOfWeek. I tried...
4
24473
by: Lisa Jones | last post by:
Hi Can someone tell me How do you get selected date form MonthCalendar control Thanks so muc Lisa
8
2622
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 12:00:00 AM" How do I get the single day date?
1
3534
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 year (July-Dec) being rendered- depending on where todays date falls. I also want today's date to be selected. This poses a problem. Refer to the code below. Add a call to createCalendar() to your constructor (AFTER the InitializeComponents()...
2
5539
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 must use DateChanged and/or DateSelected events to get the new dates
11
7393
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 Month arrows (meaning they click on either of the left or right pointing arrows in the top corner). If the user changes the month, it messes up some of the date logic that I have in the DateChanged event. Does anybody know how I can capture this...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10578
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10332
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10321
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10077
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9152
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.