Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PageFram.name screws up webbrowser.
Message
 
 
To
23/10/2003 14:41:04
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00840523
Message ID:
00841947
Views:
24
Bill,

>I do believe I finally found it. If I setfocus() to the webbrowser after resizing it, it works. The kicker though, is that focus has to be on another object when I oWeb.setfocus(). That's probably why my problem seemed to disappear and re-appear. I wasn't paying attention to where the focus was when I tested things. Now I check to see what the activecontrol is before oWeb.SetFocus() and it finally seems to be working.

I have this little test IE form and it seems to behave absolutely correctly when focus is sitting in one of the VFP controls or on the browser. Although it doesn't run from the code below because the way the CB output the ADD OBJECT for the IE instance.

PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form


Top = 0
Left = 0
Height = 430
Width = 807
DoCreate = .T.
Caption = "Form1"
Name = "form1"


ADD OBJECT txturl AS textbox WITH ;
Height = 23, ;
Left = 10, ;
Top = 13, ;
Width = 596, ;
Name = "txtURL"


ADD OBJECT command1 AS commandbutton WITH ;
Top = 14, ;
Left = 622, ;
Height = 27, ;
Width = 84, ;
Caption = "Command1", ;
Name = "Command1"


ADD OBJECT oie AS olecontrol WITH ;
Top = 52, ;
Left = 13, ;
Height = 368, ;
Width = 785, ;
Name = "oIE"


PROCEDURE Init
this.txtURL.Value = "www.microsoft.com"
ENDPROC


PROCEDURE Resize
this.oIE.Width = this.Width - 2 * this.oIE.Left
this.oIE.Height = this.Height - this.oIE.Top - 10
ENDPROC


PROCEDURE command1.Click
thisform.oIE.Navigate( thisform.txtURL.Value )

doevents
do while thisform.oIE.Busy
doevents
enddo

do while type( "thisform.oIE.Document" ) != "O"
doevents
enddo

ENDPROC


PROCEDURE oie.Refresh
*** ActiveX Control Method ***

nodefault
ENDPROC
ENDDEFINE
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform