PDA

Click to See Complete Forum and Search --> : System Enums?


Rockman
Mar 20th, 2002, 03:08 PM
Are there system-wide enums for such things as the Text Alignment Property?

I'm creating my own textbox activex (... I know, I know everybody has done that). When I add the Alignment property with the wizard, for example, it assigns an integer type. I can change the interface to a more standard drop-down box in the object browser with the following code:
Public Enum myAlignment
[Left Justify]
[Right Justify]
[Center]
End Enum

Public Property Get Alignment() As myAlignment

But I'm wondering if there is a system enum such as "vbTextAlignment" that I should use instead. This way if VB10 adds new constants to the property (say, [Justified]) I don't have to go back and change my code.

(Aside: Furthermore, by making two activeX controls, I have to be sure that the Public Enums dont conflict. Hence, I have enums "myTextBoxAlignment" and "myLabelAlignment" in two separate activex controls that define the exact same list of constants... messy)

Any help would be appreciated,
Jeff

Rockman
Mar 20th, 2002, 03:42 PM
Found a "partial" answer. There is an enum called "AlignmentConstants". You can use it this way...

Public Property Get Alignment() As AlignmentConstants

It displays the enum constants as "vbLeftJustify", "vbRightJustify", and "vbCenter"

It's not as pretty as "Left Justify", "Right Justify", and "Center", but it will do.

Anybody have a clue what the enum name is for the second set of constants?

Thanks,
Jeff