473,656 Members | 2,921 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MonthCalendar control question

I want the MonthCalendar control to return the single day selected.

I have MaxSelectionCou nt = 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?

Thanks!

Nov 21 '05 #1
8 2610

vbmark wrote:
I want the MonthCalendar control to return the single day selected.

I have MaxSelectionCou nt = 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?

Thanks!


Since you have set .MaxSelectionCo unt to 1, you will always have
..SelectionStar t = .SelectionEnd = the selected date.

--
Larry Lard
Replies to group please

Nov 21 '05 #2
"Larry Lard" <la*******@hotm ail.com> wrote in news:1115217691 .663584.133570
@f14g2000cwb.go oglegroups.com:

vbmark wrote:
I want the MonthCalendar control to return the single day selected.

I have MaxSelectionCou nt = 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?

Thanks!


Since you have set .MaxSelectionCo unt to 1, you will always have
.SelectionStart = .SelectionEnd = the selected date.


It seems that the MonthCalendar control does not have the .SelectionStart
nor the .SelectionEnd property.
Nov 21 '05 #3

vbmark wrote:
"Larry Lard" <la*******@hotm ail.com> wrote in news:1115217691 .663584.133570 @f14g2000cwb.go oglegroups.com:

vbmark wrote:
I want the MonthCalendar control to return the single day selected.
I have MaxSelectionCou nt = 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?

Thanks!
Since you have set .MaxSelectionCo unt to 1, you will always have
.SelectionStart = .SelectionEnd = the selected date.


It seems that the MonthCalendar control does not have the

..SelectionStar t nor the .SelectionEnd property.


It does in framework version 1.1:

<http://msdn.microsoft. com/library/en-us/cpref/html/frlrfsystemwind owsformsmonthca lendarclasssele ctionstarttopic .asp>

I don't know how to look stuff up for earlier framework versions,
sorry. One of the MVPs might be along soon.

--
Larry Lard
Replies to group plase

Nov 21 '05 #4
"Larry Lard" <la*******@hotm ail.com> wrote in
news:11******** **************@ f14g2000cwb.goo glegroups.com:

vbmark wrote:
"Larry Lard" <la*******@hotm ail.com> wrote in news:1115217691 .663584.133570
@f14g2000cwb.go oglegroups.com:
>
> vbmark wrote:
>> I want the MonthCalendar control to return the single day selected. >>
>> I have MaxSelectionCou nt = 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?
>>
>> Thanks!
>
> Since you have set .MaxSelectionCo unt to 1, you will always have
> .SelectionStart = .SelectionEnd = the selected date.
>


It seems that the MonthCalendar control does not have the

.SelectionStart
nor the .SelectionEnd property.


It does in framework version 1.1:

<http://msdn.microsoft.com/library/en-

us/cpref/html/frlrfsystemwind owsf ormsmonthcalend arclassselectio nstarttopic.asp >

I don't know how to look stuff up for earlier framework versions,
sorry. One of the MVPs might be along soon.


I'm using VS 2005 beta 2. Sorry, I didn't mention that.

Nov 21 '05 #5
vbmark,
| I'm using VS 2005 beta 2. Sorry, I didn't mention that.

In VS 2005 beta 2 MonthCalendar also has a SelectionStart & SelectionEnd
http://msdn2.microsoft.com/library/k...us,vs.80).aspx

http://msdn2.microsoft.com/library/1...us,vs.80).aspx

What specifically are you doing (post 5 to 10 lines of code) that you are
getting "SelectionRange : Start: 5/5/2005 12:00:00 AM, End: 5/5/2005 12:00:00
AM"?

Hope this helps
Jay
"vbmark" <no@email.com > wrote in message
news:Xn******** *************** *@199.45.49.11. ..
| "Larry Lard" <la*******@hotm ail.com> wrote in
| news:11******** **************@ f14g2000cwb.goo glegroups.com:
|
| >
| > vbmark wrote:
| >> "Larry Lard" <la*******@hotm ail.com> wrote in
| > news:1115217691 .663584.133570
| >> @f14g2000cwb.go oglegroups.com:
| >>
| >> >
| >> > vbmark wrote:
| >> >> I want the MonthCalendar control to return the single day
| > selected.
| >> >>
| >> >> I have MaxSelectionCou nt = 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?
| >> >>
| >> >> Thanks!
| >> >
| >> > Since you have set .MaxSelectionCo unt to 1, you will always have
| >> > .SelectionStart = .SelectionEnd = the selected date.
| >> >
| >>
| >> It seems that the MonthCalendar control does not have the
| > .SelectionStart
| >> nor the .SelectionEnd property.
| >
| > It does in framework version 1.1:
| >
| > <http://msdn.microsoft.com/library/en-
| us/cpref/html/frlrfsystemwind owsf
| > ormsmonthcalend arclassselectio nstarttopic.asp >
| >
| > I don't know how to look stuff up for earlier framework versions,
| > sorry. One of the MVPs might be along soon.
| >
|
| I'm using VS 2005 beta 2. Sorry, I didn't mention that.
|
Nov 21 '05 #6
I keep trying but intellesence does not give me SelectionStart or End.
Nor do I see it in the object browser. Well, here's my code.

Public Class dlgDate

Private strDate As String

Private Sub dlgDate_Load(By Val sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
With MonthCalendar1
.SetDate(frmMai n.DateSelect())
.MaxSelectionCo unt = 1
End With
End Sub

Private Sub OK_Button_Click (ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles OK_Button.Click
frmMain.DateSel ect = strDate
Me.Close()
End Sub

Private Sub MonthCalendar1_ DateChanged(ByV al sender As Object, ByVal
e As System.Windows. Forms.DateRange EventArgs) Handles
MonthCalendar1. DateChanged
strDate = MonthCalendar1. SelectionRange( ).ToString()
End Sub

End Class

"Jay B. Harlow [MVP - Outlook]" <Ja************ @msn.com> wrote in
news:uV******** ******@TK2MSFTN GP15.phx.gbl:
vbmark,
| I'm using VS 2005 beta 2. Sorry, I didn't mention that.

In VS 2005 beta 2 MonthCalendar also has a SelectionStart &
SelectionEnd
http://msdn2.microsoft.com/library/k...us,vs.80).aspx

http://msdn2.microsoft.com/library/1...us,vs.80).aspx

What specifically are you doing (post 5 to 10 lines of code) that you
are getting "SelectionRange : Start: 5/5/2005 12:00:00 AM, End:
5/5/2005 12:00:00 AM"?

Hope this helps
Jay
"vbmark" <no@email.com > wrote in message
news:Xn******** *************** *@199.45.49.11. ..
| "Larry Lard" <la*******@hotm ail.com> wrote in
| news:11******** **************@ f14g2000cwb.goo glegroups.com:
|
| >
| > vbmark wrote:
| >> "Larry Lard" <la*******@hotm ail.com> wrote in
| > news:1115217691 .663584.133570
| >> @f14g2000cwb.go oglegroups.com:
| >>
| >> >
| >> > vbmark wrote:
| >> >> I want the MonthCalendar control to return the single day
| > selected.
| >> >>
| >> >> I have MaxSelectionCou nt = 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?
| >> >>
| >> >> Thanks!
| >> >
| >> > Since you have set .MaxSelectionCo unt to 1, you will always have
| >> > .SelectionStart = .SelectionEnd = the selected date.
| >> >
| >>
| >> It seems that the MonthCalendar control does not have the
| > .SelectionStart
| >> nor the .SelectionEnd property.
| >
| > It does in framework version 1.1:
| >
| > <http://msdn.microsoft.com/library/en-
| us/cpref/html/frlrfsystemwind owsf
| > ormsmonthcalend arclassselectio nstarttopic.asp >
| >
| > I don't know how to look stuff up for earlier framework versions,
| > sorry. One of the MVPs might be along soon.
| >
|
| I'm using VS 2005 beta 2. Sorry, I didn't mention that.
|


Nov 21 '05 #7
I just learned that even though those functions do not show up they are
really there and do in fact work.

Thanks.

"Jay B. Harlow [MVP - Outlook]" <Ja************ @msn.com> wrote in
news:uV******** ******@TK2MSFTN GP15.phx.gbl:
vbmark,
| I'm using VS 2005 beta 2. Sorry, I didn't mention that.

In VS 2005 beta 2 MonthCalendar also has a SelectionStart &
SelectionEnd
http://msdn2.microsoft.com/library/k...us,vs.80).aspx

http://msdn2.microsoft.com/library/1...us,vs.80).aspx

What specifically are you doing (post 5 to 10 lines of code) that you
are getting "SelectionRange : Start: 5/5/2005 12:00:00 AM, End:
5/5/2005 12:00:00 AM"?

Hope this helps
Jay
"vbmark" <no@email.com > wrote in message
news:Xn******** *************** *@199.45.49.11. ..
| "Larry Lard" <la*******@hotm ail.com> wrote in
| news:11******** **************@ f14g2000cwb.goo glegroups.com:
|
| >
| > vbmark wrote:
| >> "Larry Lard" <la*******@hotm ail.com> wrote in
| > news:1115217691 .663584.133570
| >> @f14g2000cwb.go oglegroups.com:
| >>
| >> >
| >> > vbmark wrote:
| >> >> I want the MonthCalendar control to return the single day
| > selected.
| >> >>
| >> >> I have MaxSelectionCou nt = 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?
| >> >>
| >> >> Thanks!
| >> >
| >> > Since you have set .MaxSelectionCo unt to 1, you will always have
| >> > .SelectionStart = .SelectionEnd = the selected date.
| >> >
| >>
| >> It seems that the MonthCalendar control does not have the
| > .SelectionStart
| >> nor the .SelectionEnd property.
| >
| > It does in framework version 1.1:
| >
| > <http://msdn.microsoft.com/library/en-
| us/cpref/html/frlrfsystemwind owsf
| > ormsmonthcalend arclassselectio nstarttopic.asp >
| >
| > I don't know how to look stuff up for earlier framework versions,
| > sorry. One of the MVPs might be along soon.
| >
|
| I'm using VS 2005 beta 2. Sorry, I didn't mention that.
|


Nov 21 '05 #8
vbmark,
| strDate = MonthCalendar1. SelectionRange( ).ToString()
Ah! there's the rub.

You are asking the SelectionRange object to return the date range as a
string, ergo you are getting: "SelectionRange : Start: 5/5/2005 12:00:00 AM,
End: 5/5/2005 12:00:00 AM"

| I keep trying but intellesence does not give me SelectionStart or End.
| Nor do I see it in the object browser. Well, here's my code.
In VS.NET 2005 Beta 2 I see the SelectionStart & SelectionEnd in both
intellisence & the object browser, however I could not see them (with
minimal looking) in the Object Browser when designing the form.

FWIW:
MonthCalendar.S electionStart

MonthCalendar.S electionRange.S tart

Both refer to the start date, while:

MonthCalendar.S electionEnd

MonthCalendar.S electionRange.E nd

SelectionRange, as its name implies refers to a range of dates.

Both refer to the end date, when you have ".MaxSelectionC ount = 1" both
values with be the same date.

Hope this helps
Jay

"vbmark" <no@email.com > wrote in message
news:Xn******** *************** *@199.45.49.11. ..
|I keep trying but intellesence does not give me SelectionStart or End.
| Nor do I see it in the object browser. Well, here's my code.
|
| Public Class dlgDate
|
| Private strDate As String
|
| Private Sub dlgDate_Load(By Val sender As Object, ByVal e As
| System.EventArg s) Handles Me.Load
| With MonthCalendar1
| .SetDate(frmMai n.DateSelect())
| .MaxSelectionCo unt = 1
| End With
| End Sub
|
| Private Sub OK_Button_Click (ByVal sender As System.Object, ByVal e
| As System.EventArg s) Handles OK_Button.Click
| frmMain.DateSel ect = strDate
| Me.Close()
| End Sub
|
| Private Sub MonthCalendar1_ DateChanged(ByV al sender As Object, ByVal
| e As System.Windows. Forms.DateRange EventArgs) Handles
| MonthCalendar1. DateChanged
| strDate = MonthCalendar1. SelectionRange( ).ToString()
| End Sub
|
| End Class
|
|
|
| "Jay B. Harlow [MVP - Outlook]" <Ja************ @msn.com> wrote in
| news:uV******** ******@TK2MSFTN GP15.phx.gbl:
|
| > vbmark,
| >| I'm using VS 2005 beta 2. Sorry, I didn't mention that.
| >
| > In VS 2005 beta 2 MonthCalendar also has a SelectionStart &
| > SelectionEnd
| > http://msdn2.microsoft.com/library/k...us,vs.80).aspx
| >
| > http://msdn2.microsoft.com/library/1...us,vs.80).aspx
| >
| > What specifically are you doing (post 5 to 10 lines of code) that you
| > are getting "SelectionRange : Start: 5/5/2005 12:00:00 AM, End:
| > 5/5/2005 12:00:00 AM"?
| >
| > Hope this helps
| > Jay
| >
| >
| > "vbmark" <no@email.com > wrote in message
| > news:Xn******** *************** *@199.45.49.11. ..
| >| "Larry Lard" <la*******@hotm ail.com> wrote in
| >| news:11******** **************@ f14g2000cwb.goo glegroups.com:
| >|
| >| >
| >| > vbmark wrote:
| >| >> "Larry Lard" <la*******@hotm ail.com> wrote in
| >| > news:1115217691 .663584.133570
| >| >> @f14g2000cwb.go oglegroups.com:
| >| >>
| >| >> >
| >| >> > vbmark wrote:
| >| >> >> I want the MonthCalendar control to return the single day
| >| > selected.
| >| >> >>
| >| >> >> I have MaxSelectionCou nt = 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?
| >| >> >>
| >| >> >> Thanks!
| >| >> >
| >| >> > Since you have set .MaxSelectionCo unt to 1, you will always have
| >| >> > .SelectionStart = .SelectionEnd = the selected date.
| >| >> >
| >| >>
| >| >> It seems that the MonthCalendar control does not have the
| >| > .SelectionStart
| >| >> nor the .SelectionEnd property.
| >| >
| >| > It does in framework version 1.1:
| >| >
| >| > <http://msdn.microsoft.com/library/en-
| >| us/cpref/html/frlrfsystemwind owsf
| >| > ormsmonthcalend arclassselectio nstarttopic.asp >
| >| >
| >| > I don't know how to look stuff up for earlier framework versions,
| >| > sorry. One of the MVPs might be along soon.
| >| >
| >|
| >| I'm using VS 2005 beta 2. Sorry, I didn't mention that.
| >|
| >
| >
| >
|
Nov 21 '05 #9

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

Similar topics

10
3880
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
14250
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.
2
5107
by: Robert Misiak | last post by:
Hi everyone- I've done a lot of searching around on the web and I'm sure the answer to this question is no, but I'll ask anyway. Is it possible to create an inherited MonthCalendar control and override the member that paints the background? I've tried working with OnPaint, OnPaintBackground to no avail. Perhaps someone has a similar calendar control implementation out there? Thanks, Robert
3
11001
by: RG | last post by:
For a Windows project in VB.NET 2003: I need a Calendar that’s much larger than the MonthCalendar control in the toolbox; it needs to fill the whole screen (at least approximately ). VB won’t allow me to change the Size Height or Width Properties. I see that you can size a Calendar control in a Web project all you like; but I’m creating a Windows application project here. I see that Size comes from System.Drawing.Size...
1
3520
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()...
3
2537
by: gv | last post by:
Hi all, Using VB Express 2005 How do I get the day of the first day of the month using the MonthCalendar control. so if the MonthCalendar control is set to the systems date. thanks
2
5518
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
7370
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...
1
186
by: Brian S. | last post by:
Hi.. a few questions about monthcalendar control 1) I've added an array of bolded dates.. How do i get the back color of those dates to change? 2) I want to add a tool tip the calendar control and shows somethen about the bolded date... example would be the user hovers of the 1/1/2009.. its new years day and is bolded... now I want to set the back color for that one date to red... and then when the user hovers over it I want the tool...
0
8382
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
8816
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
8717
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...
0
7311
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...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5629
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();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1600
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.