Solved

ActiveX Component with DHTML

Posted on 2002-06-13
5
223 Views
Last Modified: 2013-11-18
Hi,

  I had developed an ActiveX Component [USER CONTROL] in Visualbasic. This user control has a textbox and a command button.
  This user control is embeded with HTML file, so that, i can use this for Internet Explorer. This HTML page contains an Input Box.
  Now, my question is, whenever i press the command button in user control, the text in the user control's textbox should be displayed in Input Box of the HTML page.
  How to implement it ?

-Prabakaran
0
Comment
Question by:mrpraba
  • 3
5 Comments
 
LVL 4

Expert Comment

by:gencross
ID: 7075381
I believe you can load the page into an HTML document object, change/add your text in the textbox, and reload the page.

I am sorry for the brief explanation, but I have not worked with the object much.
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 100 total points
ID: 7075530
In your usercontrol project add a reference to microsoft HTML object library, just as an example, try this:

Private Sub Command1_Click()
Dim iedoc As HTMLDocument
Set iedoc = UserControl.Parent
iedoc.bgColor = "#FF00FF"
End Sub

That should change backcolor of document.

You have to know the name of input box (it has a name, isn't it?) inside document. Then, if i am not wrong, write this:

Private Sub Command1_Click()
Dim iedoc As HTMLDocument
Set iedoc = UserControl.Parent
iedoc.myinputbox.value = mytextbox.text
End Sub
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7075559
mmm...
i just don't remember, maybe:
iedoc.all("myinputboxname").value = mytextbox.text
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 7075942
Use event

In usercontrol


Public Event SendMessage(ByVal Mess As String)

Private Sub Command1_Click()
RaiseEvent  SendMessage(mytextbox.text)

End Sub



In your ASP or HTML

<SCRIPT LANGUAGE=VBScript>
<!--
Option Explicit
sub myUC_SendMessage(Mess)
' set your htmpl text box
end sub
-->
</SCRIPT>

<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
  <tr>
    <td width="100%" height="100%" valign="middle" align="center">
      <object classid="clsid:E07347E1-2EB7-11D5-A038-000629E9543A" codeBase="myOCX.cab#version=2,0,0,0" id="myUC" width="100%" height="100%">
      </object>
    </td>
  </tr>
</table>
</body>
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7081092
Code didn't solve your problem?
If so, why didn't you ask for more help before accept my comment with "B" grade?
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now