Click here to Skip to main content
15,896,344 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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 :

VB
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.Show()
                selcalendar.Focus()
                selcalendar.ShowTodayCircle = True
                selcalendar.ScrollChange = 1
            Else
                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 = ""
                patname.Focus()
                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.
Posted

1 solution

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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900