By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,556 Members | 1,567 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,556 IT Pros & Developers. It's quick & easy.

MonthCalendar control question

P: n/a
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?

Thanks!

Nov 21 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a

vbmark wrote:
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?

Thanks!


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

--
Larry Lard
Replies to group please

Nov 21 '05 #2

P: n/a
"Larry Lard" <la*******@hotmail.com> wrote in news:1115217691.663584.133570
@f14g2000cwb.googlegroups.com:

vbmark wrote:
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?

Thanks!


Since you have set .MaxSelectionCount 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

P: n/a

vbmark wrote:
"Larry Lard" <la*******@hotmail.com> wrote in news:1115217691.663584.133570 @f14g2000cwb.googlegroups.com:

vbmark wrote:
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?

Thanks!
Since you have set .MaxSelectionCount 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/frlrfsystemwindowsformsmonthcalendarclassselection starttopic.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

P: n/a
"Larry Lard" <la*******@hotmail.com> wrote in
news:11**********************@f14g2000cwb.googlegr oups.com:

vbmark wrote:
"Larry Lard" <la*******@hotmail.com> wrote in news:1115217691.663584.133570
@f14g2000cwb.googlegroups.com:
>
> vbmark wrote:
>> 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?
>>
>> Thanks!
>
> Since you have set .MaxSelectionCount 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/frlrfsystemwindowsf ormsmonthcalendarclassselectionstarttopic.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

P: n/a
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*******@hotmail.com> wrote in
| news:11**********************@f14g2000cwb.googlegr oups.com:
|
| >
| > vbmark wrote:
| >> "Larry Lard" <la*******@hotmail.com> wrote in
| > news:1115217691.663584.133570
| >> @f14g2000cwb.googlegroups.com:
| >>
| >> >
| >> > vbmark wrote:
| >> >> 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?
| >> >>
| >> >> Thanks!
| >> >
| >> > Since you have set .MaxSelectionCount 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/frlrfsystemwindowsf
| > ormsmonthcalendarclassselectionstarttopic.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

P: n/a
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(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
With MonthCalendar1
.SetDate(frmMain.DateSelect())
.MaxSelectionCount = 1
End With
End Sub

Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles OK_Button.Click
frmMain.DateSelect = strDate
Me.Close()
End Sub

Private Sub MonthCalendar1_DateChanged(ByVal sender As Object, ByVal
e As System.Windows.Forms.DateRangeEventArgs) Handles
MonthCalendar1.DateChanged
strDate = MonthCalendar1.SelectionRange().ToString()
End Sub

End Class

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in
news:uV**************@TK2MSFTNGP15.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*******@hotmail.com> wrote in
| news:11**********************@f14g2000cwb.googlegr oups.com:
|
| >
| > vbmark wrote:
| >> "Larry Lard" <la*******@hotmail.com> wrote in
| > news:1115217691.663584.133570
| >> @f14g2000cwb.googlegroups.com:
| >>
| >> >
| >> > vbmark wrote:
| >> >> 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?
| >> >>
| >> >> Thanks!
| >> >
| >> > Since you have set .MaxSelectionCount 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/frlrfsystemwindowsf
| > ormsmonthcalendarclassselectionstarttopic.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

P: n/a
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**************@TK2MSFTNGP15.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*******@hotmail.com> wrote in
| news:11**********************@f14g2000cwb.googlegr oups.com:
|
| >
| > vbmark wrote:
| >> "Larry Lard" <la*******@hotmail.com> wrote in
| > news:1115217691.663584.133570
| >> @f14g2000cwb.googlegroups.com:
| >>
| >> >
| >> > vbmark wrote:
| >> >> 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?
| >> >>
| >> >> Thanks!
| >> >
| >> > Since you have set .MaxSelectionCount 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/frlrfsystemwindowsf
| > ormsmonthcalendarclassselectionstarttopic.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

P: n/a
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.SelectionStart

MonthCalendar.SelectionRange.Start

Both refer to the start date, while:

MonthCalendar.SelectionEnd

MonthCalendar.SelectionRange.End

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

Both refer to the end date, when you have ".MaxSelectionCount = 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(ByVal sender As Object, ByVal e As
| System.EventArgs) Handles Me.Load
| With MonthCalendar1
| .SetDate(frmMain.DateSelect())
| .MaxSelectionCount = 1
| End With
| End Sub
|
| Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e
| As System.EventArgs) Handles OK_Button.Click
| frmMain.DateSelect = strDate
| Me.Close()
| End Sub
|
| Private Sub MonthCalendar1_DateChanged(ByVal sender As Object, ByVal
| e As System.Windows.Forms.DateRangeEventArgs) Handles
| MonthCalendar1.DateChanged
| strDate = MonthCalendar1.SelectionRange().ToString()
| End Sub
|
| End Class
|
|
|
| "Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in
| news:uV**************@TK2MSFTNGP15.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*******@hotmail.com> wrote in
| >| news:11**********************@f14g2000cwb.googlegr oups.com:
| >|
| >| >
| >| > vbmark wrote:
| >| >> "Larry Lard" <la*******@hotmail.com> wrote in
| >| > news:1115217691.663584.133570
| >| >> @f14g2000cwb.googlegroups.com:
| >| >>
| >| >> >
| >| >> > vbmark wrote:
| >| >> >> 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?
| >| >> >>
| >| >> >> Thanks!
| >| >> >
| >| >> > Since you have set .MaxSelectionCount 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/frlrfsystemwindowsf
| >| > ormsmonthcalendarclassselectionstarttopic.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 discussion thread is closed

Replies have been disabled for this discussion.