Results 1 to 3 of 3

Thread: [2005] Wait For Mouse Click?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2008
    Posts
    92

    [2005] Wait For Mouse Click?

    Say I have a form that has a webbrowser on it, a text box and a command button.

    When I click the command button, I want to wait until the user clicks in to a field on the webbrowser control. I can then return the name of the field selected back to the textbox on the form.

    What's the best way to approach this? API? Events? I'm not really sure where to start and would really appreciate it if someone could point me in the right direction.

    Thanks
    Last edited by WarChild; Apr 13th, 2008 at 04:51 AM.

  2. #2
    Hyperactive Member cameron2's Avatar
    Join Date
    Mar 2008
    Location
    Australia
    Posts
    401

    Re: [2005] Wait For Mouse Click?

    You just need to handle the click event for whatever field you are waiting for the click.

    For example if the user click on a listbox you can do this:
    Code:
     Private Sub ListBox1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListBox1.MouseClick
            TextBox1.Text = ListBox1.Name
        End Sub
    I think this is what you are after, correct me if i'm wrong.
    If this post helped you, please click the rate button to say thank you! Remember to mark the thread as resolved too.
    Autoclicker, Hide Taskbar, Sounds on internal speaker, Changing Start Button Text (with code)

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2008
    Posts
    92

    Re: [2005] Wait For Mouse Click?

    Quote Originally Posted by cameron2
    You just need to handle the click event for whatever field you are waiting for the click.

    For example if the user click on a listbox you can do this:
    Code:
     Private Sub ListBox1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListBox1.MouseClick
            TextBox1.Text = ListBox1.Name
        End Sub
    I think this is what you are after, correct me if i'm wrong.
    Not exactly.

    What I want to do is fill in the name of a given HTML Element in to a text box.

    So you click a button and execution pauses until somebody clicks the webbrowser control and an element inside of it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width