Solved

Textfield inside ActiveX Control

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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 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…
Suggested Courses
Course of the Month5 days, 17 hours left to enroll

626 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