|
-
May 27th, 2000, 04:38 AM
#1
Thread Starter
transcendental analytic
How can i have types and enumerations that can be put in my activeX ocx so that i can use them both within the usercontrols and in the project using the controls?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 28th, 2000, 12:46 AM
#2
This is very easy, but it works only in VB5 and VB6.
Let's say I have a user control with a Picturebox on it and I need a property that will specify only certain colors (red, blue, green, black) for the picturebox on the user control:
Code:
Option Explicit
Public Enum MyColor
RED = vbRed
BLUE = vbBlue
GREEN = vbGreen
BLACK = vbBlack
End Enum
Public Property Get MyColor() As MyColor
MyColor = Picture1.BackColor
End Property
Public Property Let MyColor(ByVal New_MyColor As MyColor)
Picture1.BackColor = New_MyColor
PropertyChanged "MyColor"
End Property
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Picture1.BackColor = PropBag.ReadProperty("MyColor", BLACK)
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("MyColor", Picture1.BackColor, BLACK)
End Sub
Add this user control to the other project and try to assign value to the MyColor property, it will drop down the list with available values for this property.
Regards,
-
May 28th, 2000, 02:16 AM
#3
Thread Starter
transcendental analytic
Ok, I just got mixed up that with a usercontrol i had in a project. What about the type How can i make a type listed in the object browser?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 28th, 2000, 01:42 PM
#4
Hyperactive Member
If you mean a userdefined type, you can't. At least, you can't let is show in the property bag in a drop down list.
But, you can just create a type as you create the enum in the ocx, and you can use it both within the ocx as in the project where you use the ocx.
-
May 28th, 2000, 04:41 PM
#5
Thread Starter
transcendental analytic
Nope, i can't do that. I don't like it, i have never liked it but i have to go back to creating classmodules instead, sometimes i really need the types
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
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
|