Solved

ActiveX Component with DHTML

Posted on 2002-06-13
5
221 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

929 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

9 Experts available now in Live!

Get 1:1 Help Now