TechTalkz.com Logo Ask the Experts!

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Programing Languages > C#(C Sharp)

Click event with webbrowser control

C#(C Sharp)

 
 
Thread Tools Display Modes
Unread 07-09-2007, 02:01 PM   #1
Rotsey
Guest
 
Posts: n/a
Click event with webbrowser control

Hi,

I have a form with a webbrowser control set to fill the form.

I want to capture when the form is clicked.

As the browser control is filling the form the user would click on
the browser conttrol, but it does not have a click event.

How can I trap the click event for a form like this????

rotsey


 
Unread 07-09-2007, 03:03 PM   #2
Nicholas Paldino [.NET/C# MVP]
Guest
 
Posts: n/a
Re: Click event with webbrowser control

Rotsey,

If the web browser control fills the form, then the form will never be
clicked, because the client area of the form is taken up by the web browser
control.

What you could do is override the WndProc method of the form or
WebBrowser control and then intercept the messages going to the form. You
should be able to find a WM_CLICK message and use that to know when the web
browser control is clicked.

However, make sure you call the base implementation of WndProc, because
I am sure you want the web browser to process the click as well (unless
there is to be no interaction, and it is for display purposes only).

--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com


"Rotsey" <malcolm_smith@RemoveThis.optusnet.com.au> wrote in message
news:uoEOs9U8HHA.4584@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> I have a form with a webbrowser control set to fill the form.
>
> I want to capture when the form is clicked.
>
> As the browser control is filling the form the user would click on
> the browser conttrol, but it does not have a click event.
>
> How can I trap the click event for a form like this????
>
> rotsey
>
>



 
Unread 07-09-2007, 03:03 PM   #3
Peter Bromberg [C# MVP]
Guest
 
Posts: n/a
RE: Click event with webbrowser control

Rotsey,
If you are talking about handling the submission of a form in an
HTMLDocument that's hosted in your WebBrowser control on your Windows Form,
then you need to handle the IHTMLDocument events and IHTMLElement collection
that represents the form submission in the control, not the click event on
the windows form. This page should help:

http://support.microsoft.com/kb/313068

Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com



"Rotsey" wrote:

> Hi,
>
> I have a form with a webbrowser control set to fill the form.
>
> I want to capture when the form is clicked.
>
> As the browser control is filling the form the user would click on
> the browser conttrol, but it does not have a click event.
>
> How can I trap the click event for a form like this????
>
> rotsey
>
>
>

 
Unread 08-09-2007, 04:04 AM   #4
Rotsey
Guest
 
Posts: n/a
Re: Click event with webbrowser control

WndProc worked, thanks

"Peter Bromberg [C# MVP]" <pbromberg@yahoo.yohohhoandabottleofrum.com> wrote
in message news:925DDEA3-3099-4469-AC6E-B04E4C43F383@microsoft.com...
> Rotsey,
> If you are talking about handling the submission of a form in an
> HTMLDocument that's hosted in your WebBrowser control on your Windows
> Form,
> then you need to handle the IHTMLDocument events and IHTMLElement
> collection
> that represents the form submission in the control, not the click event on
> the windows form. This page should help:
>
> http://support.microsoft.com/kb/313068
>
> Peter
> --
> Recursion: see Recursion
> site: http://www.eggheadcafe.com
> unBlog: http://petesbloggerama.blogspot.com
> BlogMetaFinder: http://www.blogmetafinder.com
>
>
>
> "Rotsey" wrote:
>
>> Hi,
>>
>> I have a form with a webbrowser control set to fill the form.
>>
>> I want to capture when the form is clicked.
>>
>> As the browser control is filling the form the user would click on
>> the browser conttrol, but it does not have a click event.
>>
>> How can I trap the click event for a form like this????
>>
>> rotsey
>>
>>
>>



 
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
populating fields in webBrowser MR VC.NET 0 05-09-2007 09:21 AM
Re: Click to activate and use this control dfcii Internet Explorer 1 29-08-2007 02:14 AM
Re: Click to activate and use this control dfcii Internet Explorer 2 29-08-2007 02:10 AM
Re: Click to activate and use this control dfcii Internet Explorer 0 29-08-2007 02:05 AM
Re: Click to activate and use this control dfcii Internet Explorer 1 29-08-2007 01:03 AM


< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT. The time now is 03:39 AM.


vBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2013, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional