none
Keystroke (Background) RRS feed

  • Question

  • keystroke

    I would like to know how i can automate a procedure in second plan (background) no need active the window, for exemple: pressing f5 in a page web em 10 in 10 sec. but this must be done in second plan (background).

    vb.net or C#, thanks all

    Thursday, November 15, 2018 5:09 AM

All replies

  • Hi,

    Do you want to  simulate the function of a Keystroke with vb.net or C#?I think you need to describe your problem in detail.By the way,is this an asp.net project?

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, November 16, 2018 2:58 AM
  • I wanted this solution to VB.net or C#, it's not a asp.net project
    Friday, November 16, 2018 11:09 PM
  • Please be specific and describe the highlighted text as it makes absolutely no sense.

    Describe what a page is. 

    Describe what "web em" means

    Describe what "10 in 10 sec" means.

    Then explain the following


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Saturday, November 17, 2018 1:42 AM
    Moderator
  • let me try to explain.

    I wanted to know how i can make a keystroke in a window where it's not active. this keystroke must be in a interval of 5 second.

    Saturday, November 17, 2018 10:53 PM
  • Hi,

    Is this okay? Press the A button every 5 seconds

    Public Class Form1
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Dim t As New Timer With {.Interval = 5000, .Enabled = True}
            AddHandler t.Tick, Sub()
                                   TextBox1.Focus()
                                   SendKeys.Send("{A}")
    
                               End Sub
        End Sub
    End Class

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, November 19, 2018 3:31 AM
  • this help me, thanks.

    but, is it possible in a inactive window?

    Tuesday, November 20, 2018 5:55 AM
  • Hi,

    yes

    Public Class Form1
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Form2.Show()
        End Sub
    
        Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
            Dim t As New Timer With {.Interval = 5000, .Enabled = True}
            AddHandler t.Tick, Sub()
                                   Form2.TextBox1.Focus()
                                   SendKeys.Send("{A}")
    
                               End Sub
        End Sub
    End Class

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, November 20, 2018 6:19 AM