Welcome, Guest
Username: Password: Remember me
This public forum is meant for questions and discussions about Visual FoxPro
  • Page:
  • 1

TOPIC:

FoxPro Webbrowser 22 Sep 2019 19:04 #10811

  • Paula Cordeiro
  • Paula Cordeiro's Avatar
  • Topic Author



Hi!

I have a form with a grid and a object webbrowser.
The form show in the grid a list of documents, and the webbrowser make a preview of the PDF.
The problem it's when the user click on the PDF, I lost focus on my grid, even when i click on a row on the grid the focus don't work. Sometimes i have problems with the typing on keyboard after the click on the PDF.
So i have tried create a Shapebox, in front of the webbrowser , for the user don't click on the PDF, but the webbrowser appears always on the front of the shape, even when i force the Zorder.

I have the NODEFAULT in the refresh of the webbrowser.
It's any way or a trick for this?

Thank you a lot for the help :)

Please Log in or Create an account to join the conversation.

FoxPro Webbrowser 23 Sep 2019 08:03 #10819

  • lumberjack
  • lumberjack's Avatar


  • Posts: 721
  • Good day Paula,

    Are you using VFP or X# with VFP syntax to do this?
    ______________________
    Johan Nel
    Boshof, South Africa

    Please Log in or Create an account to join the conversation.

    FoxPro Webbrowser 23 Sep 2019 11:20 #10822

    • Paula Cordeiro
    • Paula Cordeiro's Avatar
    • Topic Author



    Hi !

    I'm using VFP.
    I do something like that
    this.pageframe1.page1.logrechtml.Navigate(uFile)
     this.pageframe1.page1.Sigdatagrid1.SetFocus()

    Please Log in or Create an account to join the conversation.

    FoxPro Webbrowser - Matt?? 23 Sep 2019 11:47 #10823

    • lumberjack
    • lumberjack's Avatar


  • Posts: 721
  • Matt, can you assist?

    Paula Cordeiro wrote: Hi !
    I'm using VFP.
    I do something like that

    this.pageframe1.page1.logrechtml.Navigate(uFile)
     this.pageframe1.page1.Sigdatagrid1.SetFocus()

    Hi Paula, please bear with us. VFP is a new syntax to us X# guys, so not always immediately clear what a solution would be. I am sure Matt Slay will come to the rescue...

    But in the meantime welcome to the X# website!
    ______________________
    Johan Nel
    Boshof, South Africa

    Please Log in or Create an account to join the conversation.

    FoxPro Webbrowser - Matt?? 23 Sep 2019 12:41 #10824

    • alanbourke
    • alanbourke's Avatar



    If you're doing this with actual Visual FoxPro you might have more luck posting it on StackOverflow, or Foxite or similar. I suspect it is something weird to do with the webbrowser control as opposed to VFP syntax.

    Please Log in or Create an account to join the conversation.

    FoxPro Webbrowser 23 Sep 2019 19:34 #10826

    • FoxProMatt
    • FoxProMatt's Avatar



    I do not think we should use this message board to discuss or support purely VFP issues. This forum is for discussing VFP issues related to X#.

    There are plenty of places to seek VFP help:
    Foxite, MSDN FoxPro forum, Level Extreme, Profox message board, Stack Overflow.

    Please Log in or Create an account to join the conversation.

    Last edit: by FoxProMatt.

    FoxPro Webbrowser 27 Sep 2019 22:39 #10914

    • George
    • George's Avatar


  • Posts: 106
  • Hi paula,

    I also had problem showing .pdf files in WebBrowser (in X#).
    The solution I found is to 'steal' the focus in DocumentCompleted Event.
    I do not know if it helps in your case but it seems similar.

    Here is my solution in a X# code sample:

    PUBLIC TimerStealFocus AS System.Windows.Forms.Timer

    SELF:TimerStealFocus := System.Windows.Forms.Timer{SELF:components}

    //
    // TimerStealFocus
    //
    SELF:TimerStealFocus:Interval := 500
    SELF:TimerStealFocus:Tick += System.EventHandler{ SELF, @TimerStealFocus_Tick() }

    PRIVATE METHOD WebBrowser_DocumentCompleted( sender AS System.Object, e AS System.Windows.Forms.WebBrowserDocumentCompletedEventArgs ) AS System.Void
    // WebBrowser Event sequence: FileDownload, Navigated, DocumentCompleted
    IF e:Url:ToString():ToUpper():EndsWith(".PDF")
    SELF:TimerStealFocus:Interval := 500 // 0.5 sec
    SELF:TimerStealFocus:Start()
    ENDIF
    RETURN

    PRIVATE METHOD TimerStealFocus_Tick( sender AS System.Object, e AS System.EventArgs ) AS System.Void
    SELF:TimerStealFocus:Stop()
    IF ! SELF:myGrid:Focused
    SELF:myGrid:Focus()
    ENDIF
    RETURN

    regards
    George

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1