|
-
Feb 11th, 2020, 02:06 PM
#4
Re: VB.net WinForms Control Validation not working
 Originally Posted by wjburke2
Actually this is a known bug. MSDN was able to recreate the issue and has given me a work around. One must disable and then enable the control in order to get the program buffer to update. My final code is below. JM, Thanks for your reply. I know you have much experience and I always value your input.
Code:
Private Sub dtpSL_LogIn_Date_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles dtpSL_LogIn_Date.Validating
' Fires on leave the control with/without changes
' Fires when record changes
' The program buffer does not contain the value in the control
' Disable and enable the control seems to get the current value
dtpSL_LogIn_Date.Enabled = False
dtpSL_LogIn_Date.Enabled = True
If dtpSL_LogIn_Date.Value = Save_SL_LogIn_Date Then
Exit Sub
End If
End Sub
You say this code works the way you want? I must be missing something because it doesn't look like that code does anything. No matter what the value in the dtp it just exits the Validating sub without doing anything.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|