Solved

Textfield inside ActiveX Control

Posted on 2002-05-09
4
153 Views
Last Modified: 2010-05-02
I've created an ActiveX Control with a TextBox control inside by VB 6, and will be accessed by other Program Language, say, VC++ or Delphi. What're the procedures in the VB that I need to do so as to achieve the following:

1. a function available to enable the input of the TextBox
2. a function available to disable the input of the TextBox
3. Open up the events on the TextBox, say, OnChange() and so on.

I just know that I can go to "Tool" => "Add Procedure", but not sure is the key. And don't know the steps and the coding to be added.

Thanks!
0
Comment
Question by:mscproj
[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
  • 2
4 Comments
 

Author Comment

by:mscproj
ID: 6998230
I got the answer by myself for the first two questions by using Subroutine inside "Add Procedure". But, no ideas on open up the events!
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 100 total points
ID: 6998394
What you need to do is declare events of your control in the declarations section:

Public Event OnChange()

Then in the Textbox's change event:

Private Sub Textbox1_Change()
  RaiseEvent OnChange
End Sub

For each event that you want to be able to raise in the container. This will then appear in the VB IDE in your container form in the usual drop downs and you can use:

Private Sub MyControl1_OnChange()
 
End Sub

In the code for that container.
0
 

Author Comment

by:mscproj
ID: 6998405
I saw something UserControl Interface Wizard, can it do the samething?
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6998424
Use the Wizard. I suggest that you start a new project (or at least a new control into a current project) because this wizard generates a lot of lines.

It will allow you to select current properties and methods and events for controls you put into your ActiveX control and it will write all the code for your.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error when passing an argument to a vb6 that contains  '/' 7 49
Spell Check in VB6 13 152
Help me. 3 79
Formula problem with Excel attachment 6 45
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

752 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