|
-
Aug 18th, 2006, 12:57 PM
#1
Thread Starter
Frenzied Member
Modify text on web page from ActiveX control?
Is this possible? For example, I currently have a simple ASP page with a simple ActiveX control on it. Rather than put the label within the ActiveX control itself, I want the ActiveX control to update a label on the ASP page to show some text. Any example on how to reference the ASP texbox from within the ActiveX control would be appreciated.
-
Aug 27th, 2008, 08:36 AM
#2
New Member
Re: Modify text on web page from ActiveX control?
I have the same issue, i tried using variants but I couldn't solve anything with. Any help would be appreciated.
Thanks.
-
Sep 3rd, 2008, 05:38 PM
#3
Thread Starter
Frenzied Member
Re: Modify text on web page from ActiveX control?
WOW! Talk about coming back from the dead after exactly 2 years!
-
Sep 12th, 2008, 06:21 AM
#4
New Member
Re: Modify text on web page from ActiveX control?
Hi,
Yes ofcouse you can do that using MSHTML classes. Once you create an instance of the same you can use all the wast functionality of MSHTML and the best part is its majority of the classes and properties reseble to Java Script.
Below is a sample code to write on a textbox on HTML form from a ActiveX control embedded on the same.
Code:
' For Getting Handle of current Internet Browser
Dim objCurrBrowser As HTMLWindow2
' For Getting Handle of current HTML Document
Dim docobj As MSHTML.HTMLDocument
' For Getting Handle of desired HTML object
Dim stringDataField As IHTMLElement
Set objCurrBrowser = UserControl.Parent.Script.document.parentWindow
Set docobj = UserControl.Parent.Script.document
Set stringDataField = docobj.getElementById("txtTextBoxID")
If stringDataField Is Nothing Then
Exit Function
Else
If stringDataField.innerText = "This is a test !!"
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|