?
Solved

Creating ActiveX Controls

Posted on 2000-02-23
5
Medium Priority
?
133 Views
Last Modified: 2010-05-02
How do I maintain the methods and properties of an existing VB control.
I am trying to create a "new" VB control which is based on the existing Combo box but wish to keep all of its default properties and methods
0
Comment
Question by:GScott
[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
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
paulstamp earned 150 total points
ID: 2551513
Using the VB control builder wizard you can automatically map them, otherwise you need to one by one add property let and property get statements, ie

Public Property Get Listindex() as Integer

   Listindex = combo1.listindex

End Property

Public Property Let Listindex(byval nIndex as integer)

    '@@@ need error trapping here
    combo1.listindex = nIndex

End Property

0
 

Author Comment

by:GScott
ID: 2551535
Thanks Paul (by the way where is the Control Builder Wizard?)
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2551537
From Books Online:

"Using the ActiveX Control Interface Wizard
The ActiveX Control Interface Wizard can assist you in determining what properties to provide, and in delegating to the appropriate constituent controls.
After you have placed all the constituent controls you’re going to use on your UserControl, start the wizard and select your control. The wizard will examine your constituent controls, and produce a list of all the properties, methods, and events that appear in all their interfaces, plus those in the UserControl object’s interface, and the standard properties listed above. You can select from this list those properties, methods, and events you want in your control’s interface.
The wizard will produce default mappings of your control’s properties to properties of the UserControl object or of constituent controls. In subsequent steps, you can modify these mappings.
When you have finished determining your control’s interface and delegating to existing properties, the wizard will generate property procedure code to implement the properties, using the correct data types for standard properties, and including delegation code for all your property mappings, enormously reducing the amount of work required to generate a full-featured control."
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2551549
The Wizard is an Add-In and can be selected thru Add-Ins->Add-In Manager
0
 

Author Comment

by:GScott
ID: 2551572
Thanks to Erick37
Unfortunately the answer was supplied by paulstamp a minute before your answer was received.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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

800 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