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
FoxPro Webbrowser
- lumberjack
- Posts: 729
- Joined: Fri Sep 25, 2015 3:11 pm
- Location: South Africa
FoxPro Webbrowser
Good day Paula,
Are you using VFP or X# with VFP syntax to do this?
Are you using VFP or X# with VFP syntax to do this?
______________________
Johan Nel
Boshof, South Africa
Johan Nel
Boshof, South Africa
FoxPro Webbrowser
Hi !
I'm using VFP.
I do something like that
I'm using VFP.
I do something like that
Code: Select all
this.pageframe1.page1.logrechtml.Navigate(uFile)
this.pageframe1.page1.Sigdatagrid1.SetFocus()
- lumberjack
- Posts: 729
- Joined: Fri Sep 25, 2015 3:11 pm
- Location: South Africa
FoxPro Webbrowser - Matt??
Matt, can you assist?
But in the meantime welcome to the X# website!
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...Paula Cordeiro wrote:Hi !
I'm using VFP.
I do something like thatCode: Select all
this.pageframe1.page1.logrechtml.Navigate(uFile) this.pageframe1.page1.Sigdatagrid1.SetFocus()
But in the meantime welcome to the X# website!
______________________
Johan Nel
Boshof, South Africa
Johan Nel
Boshof, South Africa
FoxPro Webbrowser - Matt??
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.
FoxPro Webbrowser
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.
There are plenty of places to seek VFP help:
Foxite, MSDN FoxPro forum, Level Extreme, Profox message board, Stack Overflow.
FoxPro Webbrowser
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
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