Reputation: 1669
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
CheckBox1.Checked = True
While CheckBox1.Checked = True
SendKeys("{END}")
End While
End Sub
That is the code, the error is "SendKeys is a type and cannot be used as an expression." How could I fix this? Thanks!
Upvotes: 1
Views: 2140
Reputation: 2923
use
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
CheckBox1.Checked = True
While CheckBox1.Checked = True
SendKeys.Send("{END}")
End While
End Sub
You need to refer SendKeys.Send();
Upvotes: 3