Results 1 to 5 of 5

Thread: CTL with Colors

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Posts
    482

    Exclamation

    Hello, I have a custom .CTL file in my APP.
    And, Its a COMMAND BUTTON.
    IT works fine, i have code to change the TEXT color, and the BACK COLOR

    But.. The Edges around the Control are still Grey
    heres what it is like

    .---------- .(GREY)
    | HEY |
    | |
    .-----------.(GREY)

    The text is a color, the Background is a color.
    BUT i can't get the GREY color to change.
    I cna't find any code that changes the border color in the CTL..

    Any help?

  2. #2
    Guest
    What about drawing your own lines with the Line method? That's what I did when I created a button.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Posts
    482
    I tryed that, but the grey was still there, and the lines didn't work too good

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Posts
    482
    if it helps this is what i have, i need to change the color tho

    Code:
        Select Case BorderType
            Case btUp
                    If bFocus Then
                        Call DrawEdge(UserControl.hdc, rct, BDR_OUTER, BF_RECT Or BF_ADJUST)
                        Call DrawEdge(UserControl.hdc, rct, EDGE_RAISED, BF_RECT)
                    Else
                        Call DrawEdge(UserControl.hdc, rct, EDGE_RAISED, BF_RECT)
                    End If
            Case btOver
                    Call DrawEdge(UserControl.hdc, rct, EDGE_RAISED, BF_RECT)
            Case btDown
                If bFocus Then
                    Call DrawEdge(UserControl.hdc, rct, BDR_OUTER, BF_RECT Or BF_ADJUST)
                    Call DrawEdge(UserControl.hdc, rct, BDR_SUNKENOUTER, BF_RECT)
                End If
        End Select
    that is in the DRAW BUTTON thing

    and this is come declares that are in it

    Code:
    Private Const BDR_RAISEDINNER = &H4
    Private Const BDR_RAISEDOUTER = &H1
    Private Const BDR_SUNKENINNER = &H8
    Private Const BDR_SUNKENOUTER = &H2
    Private Const BDR_RAISED = &H5
    Private Const BDR_OUTER = &H3
    Private Const BDR_INNER = &HC
    
    Private Const EDGE_RAISED = (BDR_RAISEDOUTER Or BDR_RAISEDINNER)
    Private Const EDGE_SUNKEN = (BDR_SUNKENOUTER Or BDR_SUNKENINNER)
    Private Const EDGE_BUMP = (BDR_RAISEDOUTER Or BDR_SUNKENINNER)
    Private Const EDGE_ETCHED = (BDR_SUNKENOUTER Or BDR_RAISEDINNER)

  5. #5
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421

    Wink

    heres a module I made it might help you get a better border
    Attached Files Attached Files
    [vbcode]
    ' comment
    Rem remark
    [/vbcode]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width