Private Sub RichTextView_TextChanged(ByVal sender As Object, ByVal e As
KeyPressEventArgs) Handles RichTextView.KeyPress, RichTextView.TextChanged
Dim c As Char = e.KeyChar
Dim i As Integer = Asc(c)
Dim h As Char = Chr(i)
capitalise_first_letter.Add(h)
End Sub
上面的代码产生错误:它在(capitalise_first_letter 是一个字符串列表)Unable to cast object of type 'System.EventArgs' to type 'System.Windows.Forms.KeyPressEventArgs'.
抛出错误。capitalise_first_letter.Add(h)
为什么?既然 h 是 e.KeyChar 进行了转换?