Click here to Skip to main content
14,386,278 members
Rate this:
Please Sign up or sign in to vote.
See more:
On clicking a text box, I have pop-upped a calendar within a form. But I am not able navigate (i.e. change the months) by using the Previous/Next buttons of the calendar. Is this a setup problem ? Please suggest.....

the code is as follows :

Private Sub labrefdt_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles labrefdt.KeyPress
        If Asc(e.KeyChar) = Keys.Enter Then
            If Len(labrefdt.Text) = 0 Then
                labrefdt.Enabled = False
                selcalendar.ShowTodayCircle = True
                selcalendar.ScrollChange = 1
                labrefdt.Enabled = False
                labrefdt.Text = Format("dd/MM/yyyy")
                GroupBox2.Enabled = True
                patname.Enabled = True
                patadd.Enabled = True
                patsex.Visible = False
                malebutton.Visible = True
                femalebutton.Visible = True
                patname.Text = ""
                patcontact.Enabled = True
                patreference.Enabled = True
            End If
        End If
    End Sub

Also how to put the selected date from the calendar into a text box.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

I don't see any reason for this not to work, but is selcalendar a child of the current form ? If it's a seperate dialog, it will have a ShowDialog method, which you should call instead to make the form modal.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100