Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WebBrowser control not the same from VFP to .NET
Message
De
21/10/2004 14:02:56
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Titre:
WebBrowser control not the same from VFP to .NET
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows 2000 SP3
Divers
Thread ID:
00953427
Message ID:
00953427
Vues:
78
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform