Solved

Textfield inside ActiveX Control

Posted on 2002-05-09
4
149 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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…

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