IE Web Browser control ActiveX control event trapping

Posted on 2006-03-29
Last Modified: 2010-05-18

I am writing an application (in C# using VS 2003) that will disaply OFFLINE HTML content in a Web Browser control.

The diaplayed HTML page will exist on the local hard drive. A portion of the page will pull web content while the rest will be an HTML form like the following:

<FORM ID="formSuggestion">
   How does this text apply to you?
   <BR />
   <INPUT ID="txtApply" TYPE="text" />
   <BR />
   <INPUT ID="btnSubmit" TYPE="submit" VALUE="Submit" />
      OR MAYBE
   <INPUT ID="btnSubmit" TYPE="button" VALUE="Submit" ONCLICK="javascript:SubmitClient();" />

When the user clicks the submit button, instead of any HTML action, I want my application to be able to extract the text from the text box control.

I will be using the Microsoft.mshtml library to gaining access to the underlying DOM is not a problem. However, I am not sure on how to access the relevant elements at the appropriate time when the user clicks Submit.

Any ideas?


Question by:raheelasadkhan
    1 Comment
    LVL 5

    Accepted Solution

    you can hook BeforeNavigate event of browser control. when you click submit the page'll start navigating, and you can process it accordingly in BeforeNavigate event handler.

    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    Article by: Ivo
    Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
    Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    26 Experts available now in Live!

    Get 1:1 Help Now