|
-
Aug 28th, 2002, 06:45 AM
#1
Thread Starter
Addicted Member
List Constants, ActiveX Control
Hi All,
I'm developing an ActiveX Control, which behaves differrently when various arguments are passed to it. I've created a property to that control for this purpose and exposed it. I am able to access the property from the client and the controls works well when the value is set.
Now, I want to know how I can provide a list of constants to be given to the property. That is, like in any other control say ListView control we have a View property. This property can be set to only the predefined constant values which popup immediately after the =, in VB IDE. I would like to know how to achieve this in my control.
Cute Member 
-
Aug 28th, 2002, 10:17 AM
#2
Frenzied Member
Create a
Public Enum Mytypes ' or whatever you want to call it
for the constants, and then in you Property Get statment
use
Property Get Myvariable () as MyTypes
-
Aug 29th, 2002, 12:46 AM
#3
Thread Starter
Addicted Member
Originally posted by jim mcnamara
Create a
Public Enum Mytypes ' or whatever you want to call it
for the constants, and then in you Property Get statment
use
Property Get Myvariable () as MyTypes
Thanx Jim I'll Try that
Cute Member 
-
Aug 29th, 2002, 02:14 AM
#4
Thread Starter
Addicted Member
Jim,
I've tried creating the Enum values and modified the property get to
Code:
Property Get pName as myEnum
But I wan to know how to modify the property let. since the type of argument for let has also to be enum type. How am i going to assign values to the property. since i cant use it as myEnum.something.
Pls. Help me on this
Cute Member 
-
Aug 29th, 2002, 03:19 AM
#5
Enum basically makes the enums as constants so you can use them to assign to the property or just an integer that is the same as a value.
VB Code:
Public Enum Stuff
WhatStuff
MyStuff
BadStuff
End Enum
Private m_Mine as Stuff
Public Property Let Mine(ByVal Value as Stuff)
m_Mine=Stuff
End Property
Public Property Get Mine() as Stuff
Mine=m_Mine
End Property
'use
obj.Mine=MyStuff
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|