Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WebBrowser control not the same from VFP to .NET
Message
From
21/10/2004 14:02:56
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Title:
WebBrowser control not the same from VFP to .NET
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows 2000 SP3
Miscellaneous
Thread ID:
00953427
Message ID:
00953427
Views:
77
Help!

I have a VFP8 form that contains the webBrowser ActiveX control. In VFP I could drill down thru the object hierarchy to get to individual elements in my HTML document.

For example,
WITH thisform.oBrowser.Document.frames('Content').document
	DO CASE
		CASE pcViewName = "1"
			oBlock = .getElementByID('block1')
			oBlock.style.display = ''
			oBlock = .getElementByID('block2')
			oBlock.style.display = 'none'
			oBlock = .getElementByID('block3')
			oBlock.style.display = 'none'
			oBlock = .getElementByID('block4')
			oBlock.style.display = 'none'

.
.
.
and this would effectively hide/display certain elements in my page.


Now when I try the same thing in C#, the compiler always complains. I'm trying the following syntax:
.
.
.
case "1":
    webHomePage.Document.frames("Content").document.getElementByID("block1").style.display = "";
    webHomePage.Document.frames("Content").document.getElementByID("block2").style.display = "none";
    webHomePage.Document.frames("Content").document.getElementByID("block3").style.display = "none";
    webHomePage.Document.frames("Content").document.getElementByID("block4").style.display = "none";
   break;
.
.
.
I get an "'object' does not contain a definition for 'frames'" message.

How do I drill down thru the DOM from .NET?

TIA
Next
Reply
Map
View

Click here to load this message in the networking platform