Results 1 to 5 of 5

Thread: Label API?

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Posts
    4

    Question

    Is there a way to change the color of the border color in a standard label control? When you change the label's appearance property to 'Flat' and borderstyle to 'Fixed Single,' it gives the label a black border. Is there a way to change the color of the border though some API method?

  2. #2
    Lively Member
    Join Date
    Mar 2000
    Posts
    82
    Someone correct me if i'm wrong.

    You are going to be stuck with what vb gives you. A label is no more than telling vb to draw something on a form. Since this is a vb only operation, windows does not know that the label exists and therefore cannot manipulate it in any way.
    VB 6.0 Pro | VC++ 6.0

  3. #3
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    Yes, I think the only way is to draw a line over them.

  4. #4
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926

    To make it easy

    Code:
    Private Sub Command1_Click()
        Call DrawBorder(Label1, vbRed)
    End Sub
    
    Private Sub DrawBorder(lbl As Label, Color As OLE_COLOR)
        With lbl
            Me.Line (.Left, .Top)-(.Left + .Width - Screen.TwipsPerPixelX, .Top + .Height - Screen.TwipsPerPixelY), Color, B
        End With
    End Sub

  5. #5
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    or just stick a Shape Control behind it.

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