Anonymous the Great
Anonymous the Great

Reputation: 1669

SendKeys not working?

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

Answers (2)

Tilak Muvva
Tilak Muvva

Reputation: 11

Use SendKeys.Send("{END}",True)

Upvotes: 1

VOX
VOX

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

Related Questions