user3649576
user3649576

Reputation: 13

how can i select date from MonthCalendar in vb.net 2012

i would like to select date from month calender in vb.net

i need to select different date for (ex: 6/11/2014) and get it then work with it in my case i can select just the current date (6/3/2014), i used the code bellow so anyone can advise???

Private Sub MonthCalendar1_DateChanged(sender As Object, e As DateRangeEventArgs)
Handles MonthCalendar1.DateChanged
Dim str As String
str = MonthCalendar1.TodayDate.ToString 
MsgBox(str)
End Sub

any update will be highly appreciated

Upvotes: 0

Views: 5699

Answers (1)

Fouche
Fouche

Reputation: 11

Private Sub calMonth_DateSelected(sender As Object, e As DateRangeEventArgs) Handles calMonth.DateSelected

Dim sMonthSelected As String 'I have this under my Public class

    sMonthSelected = calMonth.SelectionRange.Start.Date.ToString("yyyyMMdd")
    MsgBox(sMonthSelected) ' or whaterver output you require

End Sub

Upvotes: 1

Related Questions