I wrote a function that allows only numbers to be entered into the field, which is accessed through the KeyDown event. It runs as follows:
Public Sub NumbersOnly(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
If (Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57) And Asc(e.KeyChar) <> 46 And Asc(e.KeyChar) <> 8 Then
e.Handled = True
But then I realized that Pasting is impossible, so I added this clause:
If e.Control Then
If e.KeyCode = Keys.V Then
***EVALUATE EACH CHARACTER****
But, this only helps for the Ctrl+V key press. What can I do to do the same to the paste command in the popup menu?
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!