VERSION 5.00
Begin VB.UserControl MachineBG 
   Alignable       =   -1  'True
   AutoRedraw      =   -1  'True
   ClientHeight    =   5175
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   6930
   FillStyle       =   0  'Solid
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   700
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   ForwardFocus    =   -1  'True
   HitBehavior     =   2  'Use Paint
   KeyPreview      =   -1  'True
   MaskColor       =   &H00FF00FF&
   Picture         =   "MachineBG.ctx":0000
   ScaleHeight     =   345
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   462
   ToolboxBitmap   =   "MachineBG.ctx":6587A
   Begin VB.PictureBox picContainer 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1005
      Left            =   45
      ScaleHeight     =   63
      ScaleMode       =   3  'Pixel
      ScaleWidth      =   330
      TabIndex        =   0
      Top             =   1485
      Visible         =   0   'False
      Width           =   5010
      Begin VB.Image picRep 
         Height          =   900
         Index           =   4
         Left            =   3960
         Picture         =   "MachineBG.ctx":65B8C
         Top             =   45
         Width           =   960
      End
      Begin VB.Image picRep 
         Height          =   900
         Index           =   3
         Left            =   2970
         Picture         =   "MachineBG.ctx":688CE
         Top             =   45
         Width           =   960
      End
      Begin VB.Image picRep 
         Height          =   900
         Index           =   2
         Left            =   1980
         Picture         =   "MachineBG.ctx":6B610
         Top             =   45
         Width           =   960
      End
      Begin VB.Image picRep 
         Height          =   900
         Index           =   1
         Left            =   990
         Picture         =   "MachineBG.ctx":6E352
         Top             =   45
         Width           =   960
      End
      Begin VB.Image picRep 
         Height          =   900
         Index           =   0
         Left            =   0
         Picture         =   "MachineBG.ctx":71094
         Top             =   45
         Width           =   960
      End
   End
   Begin VB.Line lnDeco 
      BorderColor     =   &H00FFFFFF&
      Index           =   3
      X1              =   75
      X2              =   75
      Y1              =   183
      Y2              =   222
   End
   Begin VB.Line lnDeco 
      BorderColor     =   &H00FFFFFF&
      Index           =   2
      X1              =   69
      X2              =   69
      Y1              =   183
      Y2              =   222
   End
   Begin VB.Line lnDeco 
      BorderColor     =   &H00FFFFFF&
      Index           =   1
      X1              =   63
      X2              =   63
      Y1              =   183
      Y2              =   222
   End
   Begin VB.Line lnDeco 
      BorderColor     =   &H00FFFFFF&
      Index           =   0
      X1              =   57
      X2              =   57
      Y1              =   183
      Y2              =   222
   End
   Begin VB.Label lblData 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "Restantes: 00:04"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   195
      Index           =   5
      Left            =   0
      TabIndex        =   7
      Top             =   900
      Width           =   3750
   End
   Begin VB.Label lblData 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "Utilizado: 14:00"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   195
      Index           =   4
      Left            =   0
      TabIndex        =   6
      Top             =   900
      Width           =   2175
   End
   Begin VB.Label lblData 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "Fim: Aberto"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   195
      Index           =   3
      Left            =   0
      TabIndex        =   5
      Top             =   720
      Width           =   3750
   End
   Begin VB.Label lblData 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "Início: 14:00"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   195
      Index           =   2
      Left            =   0
      TabIndex        =   4
      Top             =   720
      Width           =   2175
   End
   Begin VB.Label lblMachine 
      BackStyle       =   0  'Transparent
      Caption         =   "01 - Mordor"
      ForeColor       =   &H00FFFFFF&
      Height          =   195
      Left            =   45
      TabIndex        =   3
      Top             =   0
      Width           =   3330
   End
   Begin VB.Image imgHeader 
      Enabled         =   0   'False
      Height          =   195
      Index           =   0
      Left            =   0
      Picture         =   "MachineBG.ctx":73DD6
      Stretch         =   -1  'True
      Top             =   0
      Width           =   3840
   End
   Begin VB.Label lblData 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "Elder"
      BeginProperty Font 
         Name            =   "Small Fonts"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   195
      Index           =   1
      Left            =   0
      TabIndex        =   2
      Top             =   450
      Width           =   3750
   End
   Begin VB.Label lblData 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "Daedaparamaxxaginos"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Index           =   0
      Left            =   0
      TabIndex        =   1
      Top             =   180
      Width           =   3765
   End
   Begin VB.Image imgHeader 
      Enabled         =   0   'False
      Height          =   195
      Index           =   1
      Left            =   0
      Picture         =   "MachineBG.ctx":73E4C
      Stretch         =   -1  'True
      Top             =   0
      Width           =   3840
   End
   Begin VB.Label lblBG 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "Restantes: 00:04"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   195
      Index           =   5
      Left            =   15
      TabIndex        =   13
      Top             =   915
      Width           =   3750
   End
   Begin VB.Label lblBG 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "Utilizado: 14:00"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   195
      Index           =   4
      Left            =   15
      TabIndex        =   12
      Top             =   915
      Width           =   2175
   End
   Begin VB.Label lblBG 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "Fim: Aberto"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   195
      Index           =   3
      Left            =   15
      TabIndex        =   11
      Top             =   735
      Width           =   3750
   End
   Begin VB.Label lblBG 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "Início: 14:00"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   195
      Index           =   2
      Left            =   15
      TabIndex        =   10
      Top             =   735
      Width           =   2175
   End
   Begin VB.Label lblBG 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "Daedaparamaxxaginos"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   255
      Index           =   0
      Left            =   15
      TabIndex        =   9
      Top             =   195
      Width           =   3765
   End
   Begin VB.Label lblBG 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "Elder"
      BeginProperty Font 
         Name            =   "Small Fonts"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   195
      Index           =   1
      Left            =   15
      TabIndex        =   8
      Top             =   465
      Width           =   3750
   End
   Begin VB.Image imgRef 
      Enabled         =   0   'False
      Height          =   900
      Left            =   90
      Picture         =   "MachineBG.ctx":73EC2
      Top             =   210
      Width           =   960
   End
   Begin VB.Line lneDeco 
      BorderColor     =   &H00BE615A&
      Index           =   1
      X1              =   30
      X2              =   300
      Y1              =   47
      Y2              =   47
   End
End
Attribute VB_Name = "MachineBG"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Event Click()
Event Resize()

    Public Enum eMachineOrdering
    MO_None = 0
    MO_Number = 1
    MO_Name = 2
    MO_TimeLeft = 3
    MO_TimeInit = 4
    End Enum

Const m_def_MachineNumber = ""
Const m_def_MachineName = ""
Const m_def_UserName = ""
Const m_def_UserClass = ""
Const m_def_TimeInit = ""
Const m_def_TimeEnd = ""
Const m_def_Selected = False
Const m_def_Status = 0
Const m_def_Order = 0
Const m_def_ForeColor = &HFFFFFF
Const m_def_BackColor = &H0

Dim m_MachineNumber As String
Dim m_MachineName As String
Dim m_UserName As String
Dim m_UserClass As String
Dim m_TimeInit As String
Dim m_TimeEnd As String
Dim m_Selected As Boolean
Dim m_Status As Long
Dim m_Order As eMachineOrdering
Dim m_ForeColor As OLE_COLOR
Dim m_BackColor As OLE_COLOR
Public Property Get Picture() As Picture
Attribute Picture.VB_Description = "Returns/sets a graphic to be displayed in a control."
Set Picture = UserControl.Picture
End Property
Public Property Set Picture(ByVal New_Picture As Picture)
Set UserControl.Picture = New_Picture
PropertyChanged "Picture"
End Property

Private Sub lblBG_Click(Index As Integer)
RaiseEvent Click
End Sub
Private Sub lblData_Click(Index As Integer)
RaiseEvent Click
End Sub
Private Sub lblMachine_Click()
RaiseEvent Click
End Sub
Private Sub UserControl_Resize()
Dim lloop As Label
RaiseEvent Resize
    
    With UserControl
    .Height = 1185
    
        For Each lloop In .lblData
        lloop.Width = IIf(lloop.Index = 2 Or lloop.Index = 4, .ScaleWidth / 2 + 8, .ScaleWidth - 8)
        lloop.Left = 0
        Next lloop
    
        For Each lloop In .lblBG
        lloop.Width = IIf(lloop.Index = 2 Or lloop.Index = 4, .ScaleWidth / 2 + 8, .ScaleWidth - 8)
        lloop.Left = 1
        Next lloop
    
    .lneDeco(1).X2 = .ScaleWidth
    .imgHeader(0).Width = .ScaleWidth
    .imgHeader(1).Width = .ScaleWidth
    
    .lnDeco(0).X1 = 0: .lnDeco(0).X2 = .ScaleWidth: .lnDeco(0).Y1 = 0: .lnDeco(0).Y2 = 0: .lnDeco(0).BorderColor = &HFFFFFF
    .lnDeco(1).X1 = 0: .lnDeco(1).X2 = 0: .lnDeco(1).Y1 = 0: .lnDeco(1).Y2 = .ScaleHeight: .lnDeco(1).BorderColor = &HFFFFFF
    .lnDeco(2).X1 = 0: .lnDeco(2).X2 = .ScaleWidth: .lnDeco(2).Y1 = .ScaleHeight: .lnDeco(2).Y2 = .ScaleHeight: .lnDeco(2).BorderColor = &H0
    .lnDeco(3).X1 = .ScaleWidth: .lnDeco(3).X2 = .ScaleWidth: .lnDeco(3).Y1 = 0: .lnDeco(3).Y2 = .ScaleHeight: .lnDeco(3).BorderColor = &H0
    
    End With
    
End Sub
'Load property values from storage
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)

    Set Picture = PropBag.ReadProperty("Picture", Nothing)
    m_Status = PropBag.ReadProperty("Status", m_def_Status)
    m_Selected = PropBag.ReadProperty("Selected", m_def_Selected)
    m_MachineNumber = PropBag.ReadProperty("MachineNumber", m_def_MachineNumber)
    m_MachineName = PropBag.ReadProperty("MachineName", m_def_MachineName)
    m_UserName = PropBag.ReadProperty("UserName", m_def_UserName)
    m_UserClass = PropBag.ReadProperty("UserClass", m_def_UserClass)
    m_TimeInit = PropBag.ReadProperty("TimeInit", m_def_TimeInit)
    m_TimeEnd = PropBag.ReadProperty("TimeEnd", m_def_TimeEnd)
    m_Order = PropBag.ReadProperty("Order", m_def_Order)
    m_ForeColor = PropBag.ReadProperty("ForeColor", m_def_ForeColor)
    m_BackColor = PropBag.ReadProperty("BackColor", m_def_BackColor)

    Call UpdateVisuals

End Sub
'Write property values to storage
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)

    Call PropBag.WriteProperty("Picture", Picture, Nothing)
    Call PropBag.WriteProperty("Status", m_Status, m_def_Status)
    Call PropBag.WriteProperty("Selected", m_Selected, m_def_Selected)
    Call PropBag.WriteProperty("MachineNumber", m_MachineNumber, m_def_MachineNumber)
    Call PropBag.WriteProperty("MachineName", m_MachineName, m_def_MachineName)
    Call PropBag.WriteProperty("UserName", m_UserName, m_def_UserName)
    Call PropBag.WriteProperty("UserClass", m_UserClass, m_def_UserClass)
    Call PropBag.WriteProperty("TimeInit", m_TimeInit, m_def_TimeInit)
    Call PropBag.WriteProperty("TimeEnd", m_TimeEnd, m_def_TimeEnd)
    Call PropBag.WriteProperty("Order", m_Order, m_def_Order)
    Call PropBag.WriteProperty("ForeColor", m_ForeColor, m_def_ForeColor)
    Call PropBag.WriteProperty("BackColor", m_BackColor, m_def_BackColor)
End Sub
Public Property Get Status() As Long
Status = m_Status
End Property
Public Property Let Status(ByVal New_Status As Long)
m_Status = New_Status
Call UpdateVisuals
PropertyChanged "Status"
End Property
'Initialize Properties for User Control
Private Sub UserControl_InitProperties()

    Call Reset
    Call UpdateVisuals

End Sub
Public Sub Reset()
Dim uLabel As Label

m_Status = m_def_Status
m_Selected = m_def_Selected
m_MachineNumber = m_def_MachineNumber
m_MachineName = m_def_MachineName
m_UserName = m_def_UserName
m_UserClass = m_def_UserClass
m_TimeInit = m_def_TimeInit
m_TimeEnd = m_def_TimeEnd
m_Order = m_def_Order
m_Order = m_def_Order
m_ForeColor = m_def_ForeColor
m_BackColor = m_def_BackColor

UserControl.lblMachine.ForeColor = m_ForeColor

    For Each uLabel In UserControl.lblData
    uLabel.ForeColor = m_ForeColor
    Next uLabel

    For Each uLabel In UserControl.lblBG
    uLabel.ForeColor = m_BackColor
    Next uLabel

End Sub
Public Property Get Selected() As Boolean
    Selected = m_Selected
End Property
Public Property Let Selected(ByVal New_Selected As Boolean)
    m_Selected = New_Selected
    UserControl.imgHeader(0).Visible = Not New_Selected
    Call UpdateVisuals
    PropertyChanged "Selected"
End Property
Public Sub UpdateVisuals()
Dim uLabel As Label, uTimeNow As Date, uTimeLeft As Date

Set UserControl.imgRef.Picture = UserControl.picRep(m_Status)

    With UserControl
    .lblMachine.Caption = m_MachineNumber & IIf(m_MachineNumber <> "" And m_MachineName <> "", " - ", "") & m_MachineName
    .lblData(0).Caption = m_UserName
    .lblData(1).Caption = m_UserClass
    .lblData(2).Caption = IIf(m_TimeInit <> "", "Início: ", "") & Format(m_TimeInit, "hh:nn")
    .lblData(3).Caption = IIf(m_TimeEnd <> "", "Fim: ", "") & Format(m_TimeEnd, "hh:nn")
    .lblData(4).Caption = ""
    .lblData(5).Caption = ""
    
        If m_TimeInit <> "" Then
        .lblData(4).Caption = "Utilizado: " & Format(Now - CVDate(m_TimeInit), "hh:nn")
        End If
    
    
        If m_TimeEnd <> "" And m_TimeInit <> "" Then
        .lblData(5).Caption = "Restante: " & Format((CVDate(m_TimeEnd) - CVDate(m_TimeInit)) - (Now - CVDate(m_TimeInit)), "hh:nn")

        
            If CVDate(m_TimeEnd) < Now() Then
            .lblData(3).FontBold = True
            .lblData(3).ForeColor = &H4040FF
            .lblBG(3).FontBold = True
            
            .lblData(5).FontBold = True
            .lblData(5).ForeColor = &H4040FF
            .lblBG(5).FontBold = True
            
            Else
            .lblData(3).FontBold = False
            .lblData(3).ForeColor = &HFFFFFF
            .lblBG(3).FontBold = False
            
            .lblData(5).FontBold = False
            .lblData(5).ForeColor = &HFFFFFF
            .lblBG(5).FontBold = False
            
            End If
        
        End If
    
    End With

UserControl.lblMachine.ForeColor = m_ForeColor

    For Each uLabel In UserControl.lblBG
    uLabel.Caption = UserControl.lblData(uLabel.Index).Caption
    Next uLabel

End Sub
Private Sub UserControl_Click()
RaiseEvent Click
End Sub
Public Property Get MachineNumber() As String
MachineNumber = m_MachineNumber
End Property
Public Property Let MachineNumber(ByVal New_MachineNumber As String)
m_MachineNumber = New_MachineNumber
PropertyChanged "MachineNumber"
Call UpdateVisuals
End Property
Public Property Get MachineName() As String
MachineName = m_MachineName
End Property
Public Property Let MachineName(ByVal New_MachineName As String)
m_MachineName = New_MachineName
PropertyChanged "MachineName"
Call UpdateVisuals
End Property
Public Property Get UserName() As String
UserName = m_UserName
End Property
Public Property Let UserName(ByVal New_UserName As String)
m_UserName = New_UserName
PropertyChanged "UserName"
Call UpdateVisuals
End Property
Public Property Get UserClass() As String
UserClass = m_UserClass
End Property
Public Property Let UserClass(ByVal New_UserClass As String)
m_UserClass = New_UserClass
PropertyChanged "UserClass"
Call UpdateVisuals
End Property
Public Property Get TimeInit() As String
TimeInit = m_TimeInit
End Property
Public Property Let TimeInit(ByVal New_TimeInit As String)
    
    If IsDate(New_TimeInit) Then
        
        If Year(CVDate(New_TimeInit)) = 1899 Then
        New_TimeInit = Date & " " & Format(New_TimeInit, "hh:mm")
        End If
    
    End If

m_TimeInit = New_TimeInit
PropertyChanged "TimeInit"
Call UpdateVisuals
End Property
Public Property Get TimeEnd() As String
TimeEnd = m_TimeEnd
End Property
Public Property Let TimeEnd(ByVal New_TimeEnd As String)

    If IsDate(New_TimeEnd) Then
        
        If Year(CVDate(New_TimeEnd)) = 1899 Then
        New_TimeEnd = Date & " " & Format(New_TimeEnd, "hh:mm")
        End If
    
    End If

m_TimeEnd = New_TimeEnd
PropertyChanged "TimeEnd"
Call UpdateVisuals
End Property
Public Sub Arrange()
Dim lCounter As Long, lParms() As String, lObj() As Control, uControl As Control, Alters As Long, Counter As Long
Dim TmpString As String, tmpObj As Control, ContainerName As String, ContainerIndex As Long, ContainerObj As Control
Dim CurrentX As Long, CurrentY As Long

    For Each uControl In UserControl.Parent.Controls
    
        If uControl.Name = ContainerName Then
        Set ContainerObj = uControl
        End If
        
        
        If TypeOf uControl Is MachineBG Then
            
            If uControl.Index <> 0 Then
            ReDim Preserve lParms(lCounter), lObj(lCounter)
            
                Select Case m_Order
                Case MO_Name
                lParms(lCounter) = uControl.MachineName
                
                Case MO_None
                lParms(lCounter) = ""
                
                Case MO_Number
                lParms(lCounter) = uControl.MachineNumber
                
                Case MO_TimeInit
                lParms(lCounter) = uControl.TimeInit
                
                Case MO_TimeLeft
                lParms(lCounter) = uControl.TimeEnd
                
                End Select
            
            Set lObj(lCounter) = uControl
            lCounter = lCounter + 1
            
            Else
            Set ContainerObj = uControl.Container
            
            End If
            
        
        End If
        
    Next uControl

lCounter = lCounter - 1

    If lCounter < 1 Then Exit Sub

'Sorting

    Do
    Alters = 0
    
    For Counter = 0 To lCounter - 1
    
        If lParms(Counter) > lParms(Counter + 1) Then
        Let TmpString = lParms(Counter + 1)
        Set tmpObj = lObj(Counter + 1)
        Let lParms(Counter + 1) = lParms(Counter)
        Set lObj(Counter + 1) = lObj(Counter)
        Let lParms(Counter) = TmpString
        Set lObj(Counter) = tmpObj
        Let Alters = Alters + 1
        End If
    
    Next Counter
    
        If (Alters = 0) Then Exit Do
    
    Loop
    
'Now rearranging.

For Counter = 0 To lCounter
lObj(Counter).Left = CurrentX
lObj(Counter).Top = CurrentY

    If CurrentX + lObj(0).Width + lObj(0).Width > ContainerObj.ScaleWidth Then
    CurrentX = 0
    CurrentY = CurrentY + lObj(0).Height
    Else
    CurrentX = CurrentX + lObj(0).Width
    End If
    
Next Counter
    



End Sub
Public Property Get Order() As eMachineOrdering
Order = m_Order
End Property
Public Property Let Order(ByVal New_Order As eMachineOrdering)
m_Order = New_Order
PropertyChanged "Order"
Call Arrange
End Property
Public Property Get ForeColor() As OLE_COLOR
ForeColor = m_ForeColor
End Property
Public Property Let ForeColor(ByVal New_ForeColor As OLE_COLOR)
m_ForeColor = New_ForeColor
PropertyChanged "ForeColor"
Call UpdateVisuals
End Property
Public Property Get BackColor() As OLE_COLOR
BackColor = m_BackColor
End Property
Public Property Let BackColor(ByVal New_BackColor As OLE_COLOR)
m_BackColor = New_BackColor
PropertyChanged "BackColor"
Call UpdateVisuals
End Property


