Solved

ActiveX Component with DHTML

Posted on 2002-06-13
5
224 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 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