c# - Opening a WebBrowser in a new form in a MDI configuration. It's opening twice for some reason -


ok strange. showed problem other developer , he's stumped too. using vb.net vs 2008.

here setup:

  • i have datagridview control, full-row selection
  • when right click on row opens context menu
  • there menu item view more information on intranet site in browser window, opens mdi child form in application.
  • the browser window basic form webbrowser control docked fill whole form
  • the browser window takes url string parameter gets sent webbrowser control navigate new page

the problem:

for reason, when choose menu item opens new browser window, opens 2 of them.

when set breakpoint on menuitem's mouseup event (i've tried click event same results), runs through whole process expected, , when reaches end sub, goes , repeats entire mouseup event method second time! can not life of me figure out why happening.

menu item's mouseup event:

private sub testmenuitemieclient_mouseup(byval sender object, byval e system.eventargs) handles testmenuitemieclient.mouseup     dim clientid string = testgrid.selectedrows(0).cells("clientid").value     dim browser browser = new browser("http://blah/client_view.aspx?clientid=" & clientid)     browser.mdiparent = main     browser.show() end sub ' <-- after point, goes , repeats whole event creates 2nd browser window 

the browser form:

public class browser     public url string      public sub new(byval url string)         mybase.new()         initializecomponent()     end sub      private sub browser_load(byval sender object, byval e system.eventargs) handles me.load         webbrowser1.navigate(new uri(url))     end sub end class 

any ideas? in advance.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -