[RESOLVED] Control property like .list ( dropdown )
All,
Is there a way to add a property to an activex control that acts like a comboBox's list property ? You know, the dropdown list but in the property box for an activex control.
I can set a variable type as a filename and get the [...] ,the ole_color color picker and even the font chooser. But no list ?
Before you ask, I don't have a particular use but if it's possible I could probably think of a few.
Keith_VB6
If you have any further questions, just ask.
If this solves things, then please mark the thread resolved.
[Thread Tools] --> [Mark Thread Resolved]
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read. Please Help Us To Save Ana
I'm actually just wondering if it's possible to add a dropdown property to the controls properties box. Like the combo.list, but more like an actual dropdown. It's like a list of choices but something that's changeable at design time. Like the UpDown control's BuddyProperty.
I know if you set a properties type in a ActiveX control then the property box for that control reflects that. Like a dropdown with True and False for a Boolean.
I guess I could always use a Propety Page and add a ComboBox on it and copy the contents or just the selected text to a variable in the control, but I just wondered if there was a more direct way through the props instead of the (custom).
Keith_VB6
If you have any further questions, just ask.
If this solves things, then please mark the thread resolved.
[Thread Tools] --> [Mark Thread Resolved]
Now that I understand what you want, use an Enum in the control and Let/Get something with that Enum.
VB Code:
Public Enum myProp
[(Default)]
Name
Caption
Index
BackColor
Left
Top
End Enum
Public Property Get EnumThing() As myProp
EnumThing = m_EnumThing
End Property
Public Property Let EnumThing(ByVal New_EnumThing As myProp)
m_EnumThing = New_EnumThing
PropertyChanged "EnumThing"
End Property
I think that's what you want.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read. Please Help Us To Save Ana
Yeah, I know how to use Enum, I was was looking for a way to make the dropdown's list changeable. Once you set a property as a particular type it's stuck that way.
As I said, I don't currently have a use for it. Although, I'd like to be able to pick something like a list of controls on a form from the dropdown and link it the usercontrol. But that could probably be easier to do in a property sheet. When the property sheet loaded, I could have the control add the controls to a dropdown.
It's just one of those, can it be done things. You never know when I might need it.
I'm learning Visual C++. So, maybe there's a way to do it through C++. It seems a more flexible language but it also requires a lot more coding.
I'll leave this thread unresolved for now, maybe someone will have an idea.Thanks for the help.
Keith_VB6
If you have any further questions, just ask.
If this solves things, then please mark the thread resolved.
[Thread Tools] --> [Mark Thread Resolved]