Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Browser Class
Message
 
 
To
08/08/2003 10:45:36
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00818239
Message ID:
00818522
Views:
13
Hi Jim,

You can directly call GoBack() and GoForward() methods of Web Browser control. Add buttons named cmdGoBAck and cmdGoForward to the form and Web Browser class will control there enabled status for you based on the control internal history.
PUBLIC oform1

SET CLASSLIB TO "h:\program files\microsoft visual foxpro 7\gallery\_webview.vcx" ADDITIVE

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


	**************************************************
*-- Form:         form1 (h:\temp\test0.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   08/08/03 10:38:03 PM
*
#INCLUDE "h:\temp\test.h"
*
DEFINE CLASS form1 AS form


	Top = 2
	Left = 10
	Height = 573
	Width = 791
	DoCreate = .T.
	Caption = "Form1"
	Visible = .T.
	Name = "Form1"
	myproperty = .F.
	numlstitm = .F.
	DIMENSION itemsel[1]


	ADD OBJECT oweb AS _webbrowser4 WITH ;
		Top = 54, ;
		Left = 6, ;
		Height = 516, ;
		Width = 780, ;
		ldebug = .T., ;
		Name = "oWeb"


	ADD OBJECT cmdgoback AS commandbutton WITH ;
		Top = 5, ;
		Left = 36, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Go Back", ;
		Enabled = .F., ;
		Name = "cmdGoBack"


	ADD OBJECT cmdgoforward AS commandbutton WITH ;
		Top = 6, ;
		Left = 132, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Go Forward", ;
		Enabled = .F., ;
		Name = "cmdGoForward"


	ADD OBJECT text1 AS textbox WITH ;
		Height = 26, ;
		Left = 246, ;
		Top = 7, ;
		Width = 426, ;
		Name = "Text1"


	ADD OBJECT cmdgo AS commandbutton WITH ;
		Top = 7, ;
		Left = 694, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Go", ;
		Name = "cmdGo"


	PROCEDURE cmdgoback.Click
		Thisform.oWeb.OBJECT.GoBack()
	ENDPROC


	PROCEDURE cmdgoforward.Click
		Thisform.oWeb.OBJECT.GoForward()
	ENDPROC


	PROCEDURE cmdgo.Click
		Thisform.oWeb.Navigate2(Thisform.text1.Value)
	ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
>All,
>
> I am using the browser class with a framed html page. I have back and forward buttons on my class, but they will not work. I've looked into why this is occurring and from what I can tell the browser control that comes with VFP 7 uses an array to track the history. Within the click event of my back button I call the goback method on the web browser control. In the logic of the goback method it checks the historycount property and if it's less than 2 then the method returns false. So the array only has the first URL in it. When I click a link on the framed page the navigate method is not firing which is where the array would be maintained. I've tried the same webpage in Internet Explorer and the back and forward buttons work fine. Has anyone else come across this? Is there a work around for this bug?
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform