RIAS
asked on
Textbox to accept only number
Hello,
I have code for the textbox to accept only number but it wont allow the user to copy the text from the textbox.
Any suggestions.
I have code for the textbox to accept only number but it wont allow the user to copy the text from the textbox.
Private Sub TxtRefCorr_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TxtRefCorr.KeyPress
Dim ClsMainForm As New ClsFrmMainLoad
If Asc(e.KeyChar) <> 13 AndAlso Asc(e.KeyChar) <> 8 AndAlso Not IsNumeric(e.KeyChar) Then
ClsMainForm.FormatMessage(20, "Udate : ", e.KeyChar, "Update")
e.Handled = True
End If
End Sub
Any suggestions.
Most simple solution would be a copy button next to the textbox. Is that a possibilty for your case (or is it inconvenient or too ugly)?
ASKER
Hello,
Thanks but think its not convenient.
Thanks but think its not convenient.
then try
Case When string Like '%D[0-9]%D[0-9]%' then 'D'+SUBSTRING(SUBSTRING(string,PATINDEX('%D[0-9]%',string)+1,LEN(string)),PATINDEX('%D[0-9]%',SUBSTRING(string,PATINDEX('%D[0-9]%',string)+1,Len(string)))+1,6) ELSE Null END
Regards
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Kim