selecting monthcalender date

Posted on 2006-03-21
Last Modified: 2010-04-23

I have an app which I need to call the date selected on the monthcalenderpicker, and send this date to a textbox.

'Code so far

            dr = cmd.ExecuteReader
            If dr.Read Then
                MsgBox("Employee Skill Combo Exists")
                If ComboBoxAccRoute.Text = "" Then
                    txtDateChosen.Text = "00/00/00"
                    txtDateChosen.Text = ExpiryDatePicker.Text
                End If
            End If
        Catch ex As SqlException
        End Try
Question by:Andrewajp002
    LVL 10

    Accepted Solution

    If u want to send a selected date to the textbox. u can do this in the click event of the datepicker

    Private Sub MyDatePicker_Click(ByVal sender As Object, ByVal e As DragEventArgs) Handles MyDatePicker.Click
      Textbox1.text = MyDatePicker.value
    End Sub


    Author Comment

    ok, datepicker works better than monthcalender thanks

    How do I just have date not time?
    LVL 10

    Expert Comment

    We have the

    which has both date and time

    Public Sub CreateMyDateTimePicker()
        ' Create a new DateTimePicker control and initialize it.
        Dim dateTimePicker1 As New DateTimePicker()
        ' Set the MinDate and MaxDate.
        dateTimePicker1.MinDate = New DateTime(1985, 6, 20)
        dateTimePicker1.MaxDate = DateTime.Today
        ' Set the CustomFormat string.
        dateTimePicker1.CustomFormat = "MMMM dd, yyyy - dddd"
        dateTimePicker1.Format = DateTimePickerFormat.Custom
        ' Show the CheckBox and display the control as an up-down control.
        dateTimePicker1.ShowCheckBox = True
        dateTimePicker1.ShowUpDown = True
    End Sub 'CreateMyDateTimePicker


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
    Introduction When many people think of the WebBrowser ( control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now