Results 1 to 2 of 2

Thread: How can I use mouse events in a .Net WebBrowser?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2006
    Location
    Barcelona
    Posts
    29

    How can I use mouse events in a .Net WebBrowser?

    Hi!
    I'm using the webbrowser subministrated by .net end I would like to know if there's anyway to, for example, click a web button by knowing its html code. I mean, I can take the html code and I can see where the button is set. Can I call any method to click this button I've found?
    I know that with the IE web browser I can do that by searching by tag name and them calling the click method, but I would like to do that with the .net control.
    THANKYOU!!!

  2. #2
    Frenzied Member bmahler's Avatar
    Join Date
    Oct 2005
    Location
    Somewhere just west of the Atlantic
    Posts
    1,568

    Re: How can I use mouse events in a .Net WebBrowser?

    yes you can you need to get the item by id and then use InvokeMember("Click")

    something like this
    VB Code:
    1. Dim doc As HtmlDocument = Me.WebBrowser1.Document
    2.         doc.GetElementById("Button").InvokeMember("Click")
    Last edited by bmahler; Dec 22nd, 2006 at 08:31 AM.
    Boooya
    • Visual Studio 2008 Professional
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • Don't forget to rate helpful posts!
    • If you're question was answered please mark your thread [Resolved]


    Code Contributions:
    PHP
    PHP Image Gallery v1.0PHP Image Gallery v2.0
    VB 2005
    Find Computers on a networkSimple License EncryptionSQL Server Database Access dllUse Reflection to Return Crystal ReportDocumentSilently Print PDFGeneric Xml Serailizer


    Useful Links: (more to come)
    MSDN (The first and foremost)MSDN Design Guidelines API Reference • Inno Setup CompilerInno Setup PreprocessorISTool - Fairly easy to use GUI for creating inno setup projects • Connection StringsNAnt -Automated BuildsCruise Control .NET - Frontend for automated builds

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