date time picker
-
I have a textbox and a date time picker. the text box is used to display the value choosen from the date time picker. When the focus is on the textbox, if the user click the ENTER key, I want that the date time picker open, and the focus is on it so the user, by using the ARROW keys, can choose a date. I know how to test the key pressed by the user, this is my code: Private Sub dtpprofdate_DropDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles dtpprofdate.DropDown Me.dtpprofdate.DropDownAlign = LeftRightAlignment.Right Me.dtpprofdate.Focus() End Sub Private Sub txtdateproforma_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtdateproforma.KeyPress If KeyAscii(e) = 13 Then dtpprofdate_DropDown(sender, e) End If End Sub IF the key is an ENTER key (KeyAscii(e) function make the checking)the DropDown event of the date time picker is fired. But the problem is that the date time picker is not opening?? Any help