compare colors

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lore Leunoeg

    #1

    compare colors

    How can I test if a form has a specific color?

    'This doesn't work
    If (Me.BackColor = System.Drawing. SystemColors.Co ntrol) Then
    Me.BackColor = Color.Tomato
    End f

    I tried some conversions which didn't work eather.

    Thank you
    Sincerely
    Lore


  • Ben Amada

    #2
    Re: compare colors

    Lore Leunoeg wrote:
    [color=blue]
    > How can I test if a form has a specific color?
    >
    > 'This doesn't work
    > If (Me.BackColor = System.Drawing. SystemColors.Co ntrol) Then
    > Me.BackColor = Color.Tomato
    > End f
    >
    > I tried some conversions which didn't work eather.
    >
    > Thank you
    > Sincerely
    > Lore[/color]

    See if this helps:


    Ben


    Comment

    • Lore Leunoeg

      #3
      Re: compare colors

      Yes, this helped :)
      Thank you very much.

      Lore

      "Ben Amada" <ben@REpoMOweVE rpick.com> schrieb im Newsbeitrag
      news:eCqCKD71FH A.1252@TK2MSFTN GP09.phx.gbl...[color=blue]
      > Lore Leunoeg wrote:
      >[color=green]
      > > How can I test if a form has a specific color?
      > >
      > > 'This doesn't work
      > > If (Me.BackColor = System.Drawing. SystemColors.Co ntrol) Then
      > > Me.BackColor = Color.Tomato
      > > End f
      > >
      > > I tried some conversions which didn't work eather.
      > >
      > > Thank you
      > > Sincerely
      > > Lore[/color]
      >
      > See if this helps:
      >[/color]
      http://groups.google.com/group/micro...dedc3488?hl=en[color=blue]
      >
      > Ben
      >
      >[/color]


      Comment

      • Ken Tucker [MVP]

        #4
        Re: compare colors

        Hi,

        Try something like this.

        If Me.BackColor.Eq uals(System.Dra wing.SystemColo rs.Control) Then
        Me.BackColor = Color.Tomato
        End If


        Ken
        -------------
        "Lore Leunoeg" <loreleunoeg@gm x.net> wrote in message
        news:djfj5r$67j $1@news01.versa tel.de...[color=blue]
        > How can I test if a form has a specific color?
        >
        > 'This doesn't work
        > If (Me.BackColor = System.Drawing. SystemColors.Co ntrol) Then
        > Me.BackColor = Color.Tomato
        > End f
        >
        > I tried some conversions which didn't work eather.
        >
        > Thank you
        > Sincerely
        > Lore
        >
        >[/color]


        Comment

        • Herfried K. Wagner [MVP]

          #5
          Re: compare colors

          "Lore Leunoeg" <loreleunoeg@gm x.net> schrieb:[color=blue]
          > How can I test if a form has a specific color?
          >
          > 'This doesn't work
          > If (Me.BackColor = System.Drawing. SystemColors.Co ntrol) Then[/color]


          <URL:http://groups.google.d e/group/microsoft.publi c.dotnet.langua ges.vb/msg/cad5236d90c3b46 d>

          --
          M S Herfried K. Wagner
          M V P <URL:http://dotnet.mvps.org/>
          V B <URL:http://classicvb.org/petition/>

          Comment

          • Carlos J. Quintero [VB MVP]

            #6
            Re: compare colors

            Be aware that there is a bug in the implementation of the Color.Equals
            function that I reported to LadyBug:



            --

            Best regards,

            Carlos J. Quintero

            MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
            You can code, design and document much faster.
            Free resources for add-in developers:
            MZ-Tools has a single goal: To make your everyday programming life easier. As an add-in to several Integrated Development Environment (IDEs) from Microsoft, MZ-Tools adds new menus and toolbars to them that provide many new productivity features.


            "Ken Tucker [MVP]" <vb2ae@bellsout h.net> escribió en el mensaje
            news:uavrO171FH A.2932@TK2MSFTN GP10.phx.gbl...[color=blue]
            > Hi,
            >
            > Try something like this.
            >
            > If Me.BackColor.Eq uals(System.Dra wing.SystemColo rs.Control) Then
            > Me.BackColor = Color.Tomato
            > End If
            >
            >
            > Ken[/color]


            Comment

            Working...