Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can container acess Enum declared in a control?

Status
Not open for further replies.

PhilX

Programmer
Apr 27, 2002
13
0
0
US
I have created an ActiveX control which has an Enumerated list of allowable values for one of its proerties. I would like to use those enuberated values in a case statement of the container's code. Is it possible to access those values?

The control contains this:
'Enumerate allowable content types for Listbox
Public Enum AllowableContents
rlbFiles = 1
rlbSingleLineText = 2
rlbFilesOrSingleLineText = 3
rlbMultiLineText = 4
rlbFilesOrMultiLineText = 5
End Enum


In my program, I would like to do this:

Function AllowTypeText(i As Integer) As String

Select Case i
Case rlbFiles
AllowTypeText = "Files"
Case rlbSingleLineText
AllowTypeText = "SingleLineText"
Case Else
AllowTypeText = "???"
End Select

End Function


Of course, the values such as "rlbFiles" are undeclared in the code of the container program. How can I declare them?

Any help or advice will be appreciated.

Phil
 
Thanks John, but I've tried that. It's very puzzling. When I type "Dim j as ", I am presented with "AllowableContents" as an intellitype (or whatever you call it) option. I complete the Dim statement, but then when I try to run it, I get "Compiler error: Can't find project or library". This is in spite of the fact that AllowableContents shows up just fine in the object browser.

Phil

(PS, I am a proud purchaser of VBCompare/VBSortGen)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top