I write code about textbox allow numbers (-) and (.) dot
However, the (-) aspect is unavailable. can help me take a look. Thanks.
Below is my code
If sg1.Text = "" Then
'sg1.Focus()
'sg1.SelectAll()
Else
Try
S1 = CDbl(CStr(sg1.Text))
Catch ex As Exception
'MsgBox("Pls fill correct number")
sg1.Text = ""
End Try
End If
If Not (Char.IsDigit(e.KeyChar) Or e.KeyChar = "." Or e.KeyChar = "-") And Not Char.IsControl(e.KeyChar)
Then
e.Handled = True
End If