Creating an Enum : Enum « Data Type « VBA / Excel / Access / Word






Creating an Enum

 

    
    Public Enum SystemMetrics
       SM_MOUSEPRESENT = 19
       SM_SWAPBUTTON = 23
       SM_MOUSEWHEELPRESENT = 75
    End Enum
    
    Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As SystemMetrics) As Long

Type RECT
   Left As Long
   Top As Long
   Right As Long
   Bottom As Long
End Type

Declare Function ClipCursor Lib "user32" (lpRect As RECT) As Long

Sub Foo()
   Dim rectClipArea As RECT
   Dim lngRetVal As Long

   With rectClipArea
      .Top = 200
      .Left = 100
      .Bottom = 420
      .Right = 280
   End With

   lngRetVal = ClipCursor(rectClipArea)

End Sub

 








Related examples in the same category

1.Working with Enumerated Types
2.Control the long integer value assigned to each item in the list, simply set the constant equal to a value