vb.net to c# of ChrW(Keys.Back)

本文关键字:Keys Back ChrW of net to vb | 更新日期: 2023-09-27 18:16:44

大家好,谁能帮我把这个代码ChrW(Keys.Back)从vb.net转换成c# ?我有这行代码在我的vb项目

If Not IsNumeric(e.KeyChar) And e.KeyChar <> ChrW(Keys.Back) Then
        e.Handled = True
End If

谢谢

vb.net to c# of ChrW(Keys.Back)

if (!Information.IsNumeric(e.KeyChar) & e.KeyChar != Strings.ChrW(Keys.Back))      {
    e.Handled = true;
}

试试吧?

if ((!IsNumeric(e.KeyChar) && (e.KeyChar != ((char)(Keys.Back))))) {
    e.Handled = true;
}