Solved

ActiveX Component with DHTML

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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.
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…

760 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

21 Experts available now in Live!

Get 1:1 Help Now