' Layout the buttons according to the orientation of the device.
'---------------------------------------------------------------
If Activity.Width > Activity.Height Then
' The device is in landscape.
'----------------------------
panelButtonBackground.Left = 10dip
panelButtonBackground.Top = 15dip
panelButtonBackground.Height = buttonVisits.Height + 25dip
buttonVisits.Left = 10dip
buttonVisits.Top = 15dip
buttonVisits.Width = 30%x
buttonMaintenance.Top = 15dip
buttonMaintenance.Width = 50%x
buttonMaintenance.Left = Activity.Width - buttonMaintenance.Width - 30dip
Else
' The device is in portrait.
'---------------------------
panelButtonBackground.Left = 10dip
panelButtonBackground.Top = 12dip
panelButtonBackground.Height = buttonVisits.Height + 20dip
buttonVisits.Left = 10dip
buttonVisits.Top = 12dip
buttonVisits.Width = 30%x
buttonMaintenance.Top = 12dip
buttonMaintenance.Width = 50%x
buttonMaintenance.Left = Activity.Width - buttonMaintenance.Width - 30dip
End If