locked
Browser navigate takes control... RRS feed

  • Question

  • I'm using browser ole class to show a pdf within a form.

    When I issue obrowser.navigate() the focus is set to the browser object. Is there a way to keep or set the focus to the object I was on when the navigate command was issued? I tried setting focus after obrowser.navigate() but it won't help.

    Thanks!

    Friday, October 18, 2019 3:47 AM

All replies

  • Hi Aleniko2,

    please check, if your oleBrowser Control also has the .Navigate2 method available. This is for opening URIs, files a.s.o. and in addition to the older .Navigate there is another Method available called .navigateComplete2 which you can use to do a SetFocus to your object.

    HTH


    Gruss / Best regards
    -Tom
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible,
    you are, by definition, not smart enough to debug it. 010101100100011001010000011110000101001001101111011000110110101101110011

    Friday, October 18, 2019 8:35 AM
    Answerer
  • Thanks will give it a try.
    Tuesday, October 22, 2019 2:19 PM
  • Hi,

    Do you resolve the issue? If you resolve the issue, please mark the helpful as answer. It will be beneficial to other community.

    Best Regards,

    Julie


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, October 25, 2019 1:16 AM
  • Tom;Unfortunately your solution didnt help.

    This was too much  of a headache - Users now just know they have to click back the main grid in order to navigate between PDFs. But thanks.

    Tuesday, November 5, 2019 10:03 PM
  • Hi Aleniko2,

    I am a bit surprised that it didn't help. Usually .Navigate2 and .NavigateComplete2 are working like a charm. Seems like some other functionality within your form breaks this.

    However, if you still used the old .Navigate and then tried to set focus within .NavigateComplete2, then it will indeed have no effect.


    Gruss / Best regards
    -Tom
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible,
    you are, by definition, not smart enough to debug it. 010101100100011001010000011110000101001001101111011000110110101101110011

    Wednesday, November 6, 2019 7:16 AM
    Answerer