Attribute VB_Name = "Positionning"
Public Enum XMODE
    HORIZONTAL = 0
    VERTICAL = 1
    BOTH = 2
End Enum

Public Enum GRADIENTMODE
    GM_HORIZONTAL = 0
    GM_VERTICAL = 1
End Enum

Public Function CenterObjectInObject(ByVal NObject1 As Object, NObject2 As Object, ByVal xDirection As XMODE)
    Select Case xDirection
        Case VERTICAL
            NObject1.Top = NObject2.Height / 2 - NObject1.Height / 2
        Case HORIZONTAL
            NObject1.Left = NObject2.Width / 2 - NObject1.Width / 2
        Case BOTH
            CenterObjectInObject NObject1, NObject2, HORIZONTAL
            CenterObjectInObject NObject1, NObject2, VERTICAL
    End Select
End Function
