Solved

Question on  ActiveX control

Posted on 1998-06-18
2
188 Views
Last Modified: 2013-11-26
1. How to attach a "File Open Dialog box" for a property of    an ActiveX control (when creating a User control)

   For ex: Using Data Control in VB, When a user                       selects Database property, an ellipse will be               appeares and when he clicks on the ellipse,                 Windows File Open dialog box is displayed.

2. How to display a no. of options for a property of an       ActiveX control DYNAMICALLY(when creating a User control)

   For ex: Using Data Control in VB, when a user gives                 Database name and when he clicks on                         RecordSource property, all the table names in               that database are dynamically displayed.

CAN ANYBODY HELP ME BY ANSWERING MY QUESTIONS?
Thanks in advance.
0
Comment
Question by:nrk
2 Comments
 

Accepted Solution

by:
cerik earned 100 total points
ID: 1463642
to answer 1.

You could try simply pasting a dialog control into your activeX and calling it in a click event mapped to the ellipse object(there is also an API cal that does the same thing),
setup the click event in the activex wizard and set the call dialog there, like

Private Sub UserControl_Click()
    'you can set default file extentions etc.. here
    CommonDialog1.showOpen
    'set database property
    data1.Database = CommonDialog1.FileName
    'but be careful if you have mapped the database property, set the internal property value and not the data1.database property directly  
    RaiseEvent Click
End Sub

 2.

Again in the activeX setup wizard add the recordset property, and further along, map it to the data control, this will give your activeX the same dropdown recordsets as the data control has, you should have something like this in your code.
 
Public Property Get Recordset() As Recordset
    Set Recordset = Data1.Recordset
End Property

You can do the same thing with datasource and other items like this.

Hope this is enough detail
0
 
LVL 2

Expert Comment

by:Jagar
ID: 1463643
For question 2 you can make and Enumeration and then declare the property to be of the enumeration type.  Make sure and make the enumeration public.  Then VB IDE will handle the rest.
I don't know about the anwser to the first question.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…

708 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

18 Experts available now in Live!

Get 1:1 Help Now