Attribute VB_Name = "Underline"
Option Explicit
Global intMode As Integer
Global intStyle As Integer
Global intWidth As Integer
Global intColor As Integer
Global lngOrigionalColor As Long


Sub CheckUnderlineState()

On Error Resume Next
'Read back underline mode into variable
    intMode = frmMain.ATX451.FontUnder
    
'The first parameter of the GetUnderline is the current state of the
'FontUnder property (input). The next three are output based on the input.
    frmMain.ATX451.GetUnderline intMode, intStyle, intWidth, intColor
    
'set the value of the corresponding option buttons for
'Style, Width and Color of the underline
    frmUnderline.optColorSelect(intColor).Value = True
    frmUnderline.optStyle(intStyle).Value = True
    frmUnderline.optWidth(intWidth).Value = True

    If frmMain.ATX451.FontColor = frmUnderline.lblColorIndex(intColor).BackColor And frmUnderline.optStyle(0).Value = False Then
        frmUnderline.chkFontColor.Value = vbChecked
    Else
        frmUnderline.chkFontColor.Value = vbUnchecked
    End If

End Sub

Sub GetUnderlineValues()

On Error Resume Next
'Read back underline mode into variable
    intMode = frmMain.ATX451.FontUnder
    
'The first parameter of the GetUnderline is the current state of the
'FontUnder property (input). The next three are output based on the input.
    frmMain.ATX451.GetUnderline intMode, intStyle, intWidth, intColor
    
'set the value of the corresponding option buttons for
'Style, Width and Color of the underline
    frmUnderline.optColorSelect(intColor).Value = True
    frmUnderline.optStyle(intStyle).Value = True
    frmUnderline.optWidth(intWidth).Value = True

End Sub

Sub MakeUnderlineSetup()

'Apply 16 colors to lblColorIndex.backcolor property using the QBColor function
    Dim intIndex As Integer
    
    For intIndex = 0 To 15
        frmUnderline.lblColorIndex(intIndex).BackColor = QBColor(intIndex)
    Next intIndex
    
End Sub

