Re: Event bubbling not working as expected

From: James Han*** (~jamie_at_darwinconsulting.com)
Date: 03/16/05


Date: Tue, 15 Mar 2005 23:23:22 -0500

The return values are all backwards in mshtml.... don't ask why, I don't
know why :)

"Anthony LaMark" <anthony@eXcSoftware.com> wrote in message
news:OxPjJHYKFHA.3076@tk2msftngp13.phx.gbl...
> Hi All,
>
> I have a C# WinForm application that uses the webbrowser control. When
> the
> webbrowser control loads the html page, there is a table on the page that
> has some buttons in the table cells and also some input elements (text
> field, check box, list box). When the user clicks one of the buttons in
> the
> table, I have a method in the C# code that has registered to receive
> "onclick" events for the table (I read that this is acceptable since the
> html DOM is hierarchical and the event percolates from the child up).
> This
> all works great. The problem is that for the other input element controls
> in the table, the event is consuming the click (and I do not want it to).
> So, for example, to get the listbox dropdown to appear, I have to double
> click really fast since if I just single click, it does nothing. The C#
> method that consumes the onclick event returns a bool and I set the return
> value to be false if the button is clicked (false = cancel default
> action).
> For everthing else (i.e. listbox, checkbox, text field), I set the return
> value to be true. The method also takes as input a IHTMLEventObj object
> (the variable is named e). I set e.returnValue to be the same value as
> the
> return code for the method. So, can someone tell me which value is
> relevant
> (the return code from the method, e.returnValue or both) and why my logic
> does not seem to be having the desired effect on the non-button controls?
>
> Thanks in advance.
>
>