WebBrowser Class Stealing Focus from (ComboBox) Drop Down List

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,
I have coded a multi-threaded application in C# using VS 2010. It contains a WebBrowser class and several ComboBoxes that are Drop Down Lists. I am experiencing a problem when the browser finishes loading the web page, it steals the focus from
the ComboBox that is currently selected. I put code in the DocumentCompleted Event for the WebBrowser. It does put the focus back to the ComboBox, but the Drop Down has been closed during the process of switching focus back and forth between the
WebBrowser and the ComboBox. So the user is very confused since they have to click the drop down list button again to re-open the drop down list and finish making their selection. Does anyone have a work-around for this. Maybe I can detect
if the comboBox (drop down list) is dropped down, and force it to drop down again when focus returns to it?
Please help...thoroughly confused. They really should put a property on the webbrowser to indicate if it is okay to set focus when it finishes loading a web page.
Thanks,
Michael McDonald

View the full article
 
Back
Top