Advertisement
Java_Volume1 OLE/ COM/ DCOM/ Active-X #98069

Enumeration Spelling

How to keep the upper/lower case of Enumeration members

AI

AI 摘要: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

源代码
original-source
Option Explicit
'Due to a bug in VB members of an Enumeration do
'not keep their upper/lower case when they are
'typed differently in code. There is a simple
'solution however. All you have to do is repeat
'the'member names with their proper spelling and 
'case bracketed by
#If False Then
#End If
'as the following example shows:
Public Enum TTStyle
  TTStandardIfActive = TTS_STANDARD
  TTBalloonIfActive = TS_BALLOON
  TTStandardAlways = TTS_STANDARD Or TTS_ALWAYSTIP
  TTBalloonAlways = TTS_BALLOON Or TTS_ALWAYSTIP
  TTNone = -1
End Enum
#If False Then
Private TTStandardIfActive, TTBalloonIfActive, TTStandardAlways, TTBalloonAlways, TTNone 'to preserve the case
#End If
原始评论 (3)
从 Wayback Machine 恢复