Solved

Creating ActiveX Controls

Posted on 2000-02-23
5
129 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
  • 2
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
paulstamp earned 50 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

Title # Comments Views Activity
change vba from autofit to 13.5 width? 4 29
How to debug this code 7 64
Advice in Xamarin 21 97
Collapse and expand table in Word 2010 2 39
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

830 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