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.
| >|
| >
| >
| >
|