VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Put The Code In a Module and Call It from any Form. Amazing The Form Appear in Multi Color

by Prasad Patnaik (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 29th June 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Put The Code In a Module and Call It from any Form. Amazing The Form Appear in Multi Color

Rate Put The Code In a Module and Call It from any Form. Amazing The Form Appear in Multi Color



   Const intBLUESTART% = 255
    Const intBLUEEND% = 0
    Const intBANDHEIGHT% = 2
    Const intSHADOWSTART% = 8
    Const intSHADOWCOLOR% = 1
    Const intTEXTSTART% = 4
    Const intTEXTCOLOR% = 15
    Const intRed% = 2 '1
    Const intGreen% = 4 '2
    Const intBlue% = 8  '4
    Const intBackRed% = 16 '8
    Const intBackGreen% = 16
    Const intBackBlue% = 32
    Dim sngBlueCur As Single
    Dim sngBlueStep As Single
    Dim intFormHeight As Integer
    Dim intFormWidth As Integer
    Dim intY As Integer
    Dim iColor As Integer
    Dim iRed As Single, iBlue As Single, iGreen As Single
    
    '
    'Get system values for height and width
    '
    intFormHeight = theForm.ScaleHeight
    intFormWidth = theForm.ScaleWidth

    'If ReadIniFile(gstrSetupInfoFile, gstrINI_SETUP, gstrINI_COLOR) = vbNullString Then
        iColor = 109 '155
    'Else
      '  iColor = CInt(ReadIniFile(gstrSetupInfoFile, gstrINI_SETUP, gstrINI_COLOR))
    'End If
    'Calculate step size and blue start value
    '
    sngBlueStep = intBANDHEIGHT * (intBLUEEND - intBLUESTART) / intFormHeight
    sngBlueCur = intBLUESTART
    'Paint blue screen
    For intY = 0 To intFormHeight Step intBANDHEIGHT
        If iColor And intBlue Then iBlue = sngBlueCur
        If iColor And intRed Then iRed = sngBlueCur
        If iColor And intGreen Then iGreen = sngBlueCur
        If iColor And intBackBlue Then iBlue = 255 - sngBlueCur
        If iColor And intBackRed Then iRed = 255 - sngBlueCur
        If iColor And intBackGreen Then iGreen = 255 - sngBlueCur
        theForm.Line (-1, intY - 1)-(intFormWidth, intY + intBANDHEIGHT), RGB(iRed, iGreen, iBlue), BF
        sngBlueCur = sngBlueCur + sngBlueStep
    Next intY
    'Print 'shadowed' appname
    theForm.CurrentX = intSHADOWSTART
    theForm.CurrentY = intSHADOWSTART
    theForm.ForeColor = QBColor(intSHADOWCOLOR)
    theForm.Print theForm.Caption
    theForm.CurrentX = intTEXTSTART
    theForm.CurrentY = intTEXTSTART
    theForm.ForeColor = QBColor(intTEXTCOLOR)
    theForm.Print theForm.Caption
End Sub

Download this snippet    Add to My Saved Code

Put The Code In a Module and Call It from any Form. Amazing The Form Appear in Multi Color Comments

No comments have been posted about Put The Code In a Module and Call It from any Form. Amazing The Form Appear in Multi Color. Why not be the first to post a comment about Put The Code In a Module and Call It from any Form. Amazing The Form Appear in Multi Color.

Post your comment

Subject:
Message:
0/1000 characters