HiI have the following code. I need to test an entry in the textbox to check if entry is a valid date.- I would like to use the MaskedTextBox function in this click event and then limit the entry to date only in the KeyPress event.Private Sub CheckDate_Validating(sender As Object, e As EventArgs) Handles CheckDate.MouseClickDim dt As String = DateTime.NowFormat(dt, "MM/dd/yy")' Configure the message box to be displayedDim messageBox1Text As String = "is Not a valid date"Dim messageBox2Text As String = "IS a valid date"If Date.TryParseExact(txtDoj.Text.ToString(), "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture, Globalization.DateTimeStyles.None, dt) Then' Display message boxMessageBox.Show(messageBox2Text)Else' Display message boxMessageBox.Show(messageBox1Text)EndEnd IfEnd SubPrivate Sub txtDoj_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtDoj.KeyPressEnd SubPlease help. Thanks