• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 316
  • Last Modified:

System.Windows.Forms.SendKeys to Perform Alt Key Press When The Form Loads


Hi,

I’m using VS.NET 2005.  I’m trying to use the System.Windows.Forms.SendKeys to perform the Alt key press when the form loads.  The reason I need to do this is because I’m using Short Cut Keys/Hot Keys on my command buttons, and they do not display the Hot Keys unless the Alt key is pressed.  The following code does not work:


        System.Windows.Forms.SendKeys.Send("Alt")



Thanks,
Denise
0
DeniseGoodheart
Asked:
DeniseGoodheart
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Try...

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        SendKeys.Send("%")
    End Sub
0
 
DeniseGoodheartAuthor Commented:
Many thanks Idel Mind for your help.

Cheers,
Denise
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

Tackle projects and never again get stuck behind a technical roadblock.
Join Now