VB6 IDE changes case enumeration names

I need to support multiple VB6 applications, and I ran into some strange problem when it comes to enum names. The way Intellisense in VB6 should work is that if my variable name is defined as, say, Dim Abraxis as String, and I type abraxis during encoding, the IDE changes it to Abraxis β€œon the fly” when I leave the word . However, I found that if I have an enum configured in this way, for example:

Public Enum tiErrorEnum
  tiNone = 0
  tiWarning
  tiError
  tiDupDoc
End Enum

and I use one of the enumerations in the instruction, for example

ErrorNum = tinone

expecting the enclosure to be fixed by the IDE, it will not change tinone to tiNone, but it will change the def of the enum member to tinone! Right back!

Is there a workaround?

+5
3

, . , , , , , , . (, , ). , :

Public Enum tiErrorEnum
  tiNone = 0
  tiWarning
  tiError
  tiDupDoc
End Enum
#If False Then
  Public tiNone
  Public tiWarning
  Public tiError
  Public tiDupDoc
#End If

Simple. IDE , .

+13

. , , , intellisense, .

+1

, :

tiErrorEnum.tiDupDoc

Intellisense will then enumerate correctly after clicking the dot. I think this will also help to read the code if you named the enumeration correctly.

+1
source

All Articles