Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用按键事件。它的工作..但我需要显示十进制值。它只能在没有“.(dot)”的情况下访问
If txtunit. Focused = True Then If Not Char.IsNumber(e.KeyChar) And Not e.KeyChar = Chr(Keys.Back) Then e.Handled = True End If End If
尝试包括Chr(46)是哪个时期的。
Chr(46)
If (Not Char.IsDigit(e.KeyChar) And Not e.KeyChar = Chr(Keys.Back) And Not e.KeyChar = Chr(46)) Then e.Handled = True End If
如果您想禁用在文本框中粘贴,您也可以这样做:
txtUnit.ShortcutsEnabled = False
虽然上面也会禁用复制。