how to stimulat Ctrl+alt+i and Ctrl+alt+n keyboard key press in vb.net?

Edited 2 Years Ago by xn hunk

In an input control, such as a textbox, the keyeventargs of the keydown event give you access to information on whether the alt and/or control keys were pressed as well as which regular input key:

Private Sub TextBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles TextBox1.KeyDown
    If e.Alt AndAlso e.Control Then
        If e.KeyCode = Keys.N Then
            MessageBox.Show("N")
        ElseIf e.KeyCode = Keys.I Then
            MessageBox.Show("I")
        End If
    End If
End Sub

Edited 2 Years Ago by tinstaafl

thnk but ,want to stimulat Ctrl+alt+i keyboard key press in vb.net, not find what key was press.

Edited 2 Years Ago by xn hunk

Oh you mean simulate If you want to do this for a specific process the Process Class will allow you to send any keypress combination to the process.

Edited 2 Years Ago by tinstaafl

simulate , that was a typo
and seem this site dont have an edit button after sign out .
and Keyboard.SendKey
"^%n"
("^%{n}") combination dont work.

Edited 2 Years Ago by xn hunk

Are you trying to send this to a form you created in VB .NET or to a window in another program?

Also, you can edit a post after you sign out and sign back in. However, there is a 30 min cutoff. After 30 mins you are no longer able to edit a post. If you don't press the refresh button on your browser after clicking "Save Changes", and edit the post again, the previous update is lost. Also, you need to refresh your browser to update the posting time.

Edited 2 Years Ago by cgeier

trying to send it to to a window in another program yahoo

why a cutoff after 30 min , user has the right to edit any post posted by him on other site why not here ,
it would be bettter for user and other member , that way atleast the post wont appear mess.

Edited 2 Years Ago by xn hunk

look at this ex , post got reposted , the sever at your site was slow to upate at first
any way keep up the good work.

Edited 2 Years Ago by xn hunk

tinstaa frgt messenger , what about Ctrl+alt+n keyboard key press to a window in another program in vb.net.

Edited 2 Years Ago by xn hunk

Redirect the standard input of the process. All the information is included in links in that page, especially the StartInfo property

O.K. just a couple of points. A) The program you want to send a key combinations to need to be programmed to accept this combination. B) Windows always intercepts key presses and somewhat redirects these if the program you want to send these to doesn't accept these. So here is a small snippet using notepad to send keys to:

Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Shell("notepad", vbNormalFocus)
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        AppActivate("notepad")
        SendKeys.Send("text1")
        SendKeys.Send("{TAB}")
        SendKeys.Send("text2")
        SendKeys.Send("{TAB}")
        SendKeys.Send("{ENTER}")
        SendKeys.Send("^(a)") 'for Ctrl-A for select all
        SendKeys.Send("^(n)") 'create new notepad
        SendKeys.Send("^(s)") 'for control and S - save notepad
    End Sub
End Class

Have you tried using all teh key events together?

Edited 2 Years Ago by Michael_9: more info

This article has been dead for over six months. Start a new discussion instead.