e.KeyCode返回' A'而不是'

时间:2018-06-11 05:56:18

标签: c# visual-studio-2015 textbox listbox keydown

This is my checkbox code <form action="" method="POST"> <h4 id="result"></h4> <div class="container"> <h2 align="center">Table App Feature</h2> <table id="appFeature" class="table table-hover" align="center" style="width:500px;margin:auto;"> <thead> <tr> <th>Firstname</th> <th>Please check to enable the features</th> </tr> </thead> <tbody> <tr> <td>Smarthome</td> <td> <input type="checkbox" class="get_value" value="1" /> </td> </tr> <tr> <td>Intercom</td> <td> <input type="checkbox" class="get_value" value="1" /> </td> </tr> <tr> <td>Visitors</td> <td> <input type="checkbox" class="get_value" value="1" /> </td> </tr> <tr> <td>Booking</td> <td> <input type="checkbox" class="get_value" value="1" /> </td> </tr> <tr> <td>Access</td> <td> <input type="checkbox" class="get_value" value="1" /> </td> </tr> <tr> <td>Parcel</td> <td> <input type="checkbox" class="get_value" value="1" /> </td> </tr> <tr> <td>Bills</td> <td> <input type="checkbox" class="get_value" value="1" /> </td> </tr> <tr> <td>Invoices</td> <td> <input type="checkbox" class="get_value" value="1" /> </td> <tr> <td>Receipts</td> <td> <input type="checkbox" class="get_value" value="1" /> </td> </tr> <tr> <td>Transactions</td> <td> <input type="checkbox" class="get_value" value="1" /> </td> </tr> <tr> <td>Meeting</td> <td> <input type="checkbox" class="get_value" value="1" /> </td> </tr> <tr> <td>Vote</td> <td> <input type="checkbox" class="get_value" value="1"/> </td> </tr> <tr> <td>Feedback</td> <td> <input type="checkbox" class="get_value" value="1" /> </td> </tr> </tbody> </table><br /> <div align="center"> <button type="button" name="submit" id="submit">Update</button> </div> </div> </form>中,我评估listBox_KeyDown条件。但它检测大写字符而不是小写字母(实际是键入的)。如何获取它来捕获输入的实际字符?代码如下:

e.KeyCode

1 个答案:

答案 0 :(得分:1)

使用KeyPress事件,它在KeyChar中具有KeyPressEventArgs属性。它将为您提供正在按下的实际角色