Operator '==' cannot be applied to operands of type 'char' and 'string'

后端 未结 1 597
不知归路
不知归路 2021-01-14 11:30

I have a registration application which has the \"KeyChar\" event inside it, and it works great ! but when i give the same lines of code in this application it gives me

相关标签:
1条回答
  • 2021-01-14 11:46

    Use the character. Single quotes ' define a character, while double quotes " define a string:

    if (e.KeyChar == 'L')
    
    0 讨论(0)
提交回复
热议问题