Solved

Textfield inside ActiveX Control

Posted on 2002-05-09
4
150 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
  • 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 69

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

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

Title # Comments Views Activity
vba find the last empty column 10 88
How to Add / Edit Windows Menu 4 52
clicking a shape in a frame array vb6 3 40
MsgBox 4 47
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 was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

920 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

17 Experts available now in Live!

Get 1:1 Help Now