CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Location
    Toronto
    Posts
    167

    comparing background colours

    is there a way to compare the background of 2 labels ?

    if label1.background = label2.background then

    doesn't work and I can't find a way to get the colour name into a string variable i.e.

    dim colour as string

    colour = label1.background

    I'm sure there's a way, I am just drawing a complete blank

    Thanks

    Jym

  2. #2
    Join Date
    Oct 2002
    Location
    Växjö, Sweden
    Posts
    225
    Code:
    If Label1.BackColor.ToString = Label2.BackColor.ToString Then
        MsgBox("Same")
    Else
        MsgBox("Not same")
    End If
    /Leyan

  3. #3
    Join Date
    May 2002
    Location
    Toronto
    Posts
    167
    well doesn't that make all the sense in the world :-)

    Thank you

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

Featured