Re: annoying name changing
you can declare it as a PUBLIC CONST seperately instead of declaring it in that Public Enum function.
public Const MyConst = 3
.
.
.
public Enum... MyConst...
.
.
.
If MyVar = MyConst then
.
.
.
[email protected]
Re: annoying name changing
yes, ofcourse but that is the whole idea of Enum, creating a union of consts...
----------
The @host is everywhere!
----------
Re: annoying name changing
Tried a little test case and could not duplicate your described error. I am using VB 6.0 Pro edition. Here is the sample I used.
'
' In a module
'
option Explicit
public Enum MyConstants
MyConst = 1
End Enum
'
'
In a form
'
option Explicit
private Sub Text1_Change()
Text1 = MyConst
End Sub
I keyed the Text1 = myconst and VB IDE changed it to MyConst just like it is spelled in the Enum not viceversa as you specified. Look for another usage of the myconst in your program that could be effecting the outcome.
John G
Re: annoying name changing
No - I get the behaviour described in VB5(SP2)
It may have been fixed in VB6.
I developed a peculiar coding style as a result:
'usual code
Select Case EventVB.WindowMessage
Case WM_MOVE
Case else
End Select
'workaround thingy
Select Case true
Case EventVB.WindowMessage = WM_MOVE
Case else
End Select
That way the IDE always provides you with a dropdown of the enumerated type options so you don't get the chance of changing their case.
HTH,
Duncan
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.
Re: annoying name changing
I tried out my example on VB 5.0 (no service pack ) and it fails for me also.
John G