Solved

ActiveX Component with DHTML

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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…
Suggested Courses
Course of the Month9 days, 19 hours left to enroll

623 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