Standard Form Color?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Coolboy55
    New Member
    • Jul 2007
    • 67

    Standard Form Color?

    Does anyone know what the RGB values are for the standard Access form color?

    Thanks!
  • Trevor2007
    New Member
    • Feb 2008
    • 68

    #2
    I don't think RGB color values will work in access but here is the default form color access value -2147483633

    Comment

    • missinglinq
      Recognized Expert Specialist
      • Nov 2006
      • 3533

      #3
      You can use RGB color values in Access VBA, but I know no one who does and have no clue how they're used or the paticular combinations.

      What Trevor2007 gave you is the Windows ColorID for the standard Access background. The advantage in using these in Access is that it assures you that your app will reflect the end users' preferences, if they've gone into Windows Control Panel and changed things from the defaults. For instance, a user that's modified his/her color scheme in Windows may have bluish green command buttons, which is the color they'll be in your app, since you can't set this property in Access.

      If you've used a pallette and chosen a bright red as your form backcolor , it may look fine with your Windows color scheme, but bluish green command buttons will certainly clash with the red on the user's machine! But if you only use the Windows color codes, you know that they'll blend in with the user's choices.

      These color codes can be used in VBA code as well as in the Property Sheet.

      Code:
      Color ID..... Color Description
      
        ---------------------------------
      
        -2147483648 Scroll bar
      
        -2147483647 Desktop
      
        -2147483646 Active window title bar
      
        -2147483645 Inactive window title bar
      
        -2147483644 Menu bar
      
        -2147483643 Window
      
        -2147483642 Window frame
      
        -2147483641 Menu Text
      
        -2147483640 Window Text 
      
      
         -2147483639 Title bar text
      
        -2147483638 Active window border
      
        -2147483637 Inactive window border
      
        -2147483636 Application background
      
        -2147483635 Highlight
      
         -2147483634 Highlight Text
      
        -2147483633 3-D face 
      
        -2147483632 3-D shadow
      
        -2147483631 Dimmed (disabled) text
      
        -2147483630 Button Text
      
        -2147483629 Inactive window title bar text
      
        -2147483628 3-D highlight  
      
      -2147483627 3-D dark shadow
      
        -2147483626 3-D light
      
        -2147483625 ToolTip Text
      
        -2147483624 ToolTip background
      
        -2147483621 Active window title bar color2
      Linq ;0)>

      Comment

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        Life is strange! Doing something totally unrelated to your post, I came scross the numbers you need:

        R 192
        G 192
        B 192

        Linq ;0)>

        Comment

        • Coolboy55
          New Member
          • Jul 2007
          • 67

          #5
          Originally posted by missinglinq
          Life is strange! Doing something totally unrelated to your post, I came scross the numbers you need:

          R 192
          G 192
          B 192

          Linq ;0)>
          Wow, thanks for all the information! I'll be sure to use your recommendations from your first post. Is there a way to contribute to these forums? The experts here are so useful!

          Comment

          • missinglinq
            Recognized Expert Specialist
            • Nov 2006
            • 3533

            #6
            The way to "contribute " is to the site is to
            1. Tell friends who program about us
            2. Come back often
            3. Once you've gained some experience, help to answer questions
            Linq ;0)>

            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32634

              #7
              To determine the RGB factors for a colour given in a colour property consider it as a number where Red, Green & Blue are all assigned 8 bits each.
              Red is the least-significant portion of the number, then Green and then Blue.

              Consider (for simplicity of explanation) you have three factors - {R}, {G} & {B}. The number in the property would be {R} + ({G} * 256) + ({B} * 65536).
              256 = 2^8 & 65536 = 2^16.

              Reversing this process I have created a simple spreadsheet (formulae shown below) which determines the three factors when you enter the property value in cell A1 :
              Code:
              .   A             B
              8421631   =MOD($A$1,2^8)
                        =INT(MOD($A$1,2^16)/2^8)
                        =INT(MOD($A$1,2^24)/2^16)
              This value is for a dark pink I found in the top left of the colour grid. The values displayed in my spreadsheet were :
              Code:
              .  A      B
              8421631  255
                       128
                       128

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32634

                #8
                Any of the negative numbers quoted so far are predefined constants and they are NOT RGB values.

                As explained, an RGB value is constrained to the least significant 24 bits of a 32-bit value. Negative numbers, by definition, use the most significant bit (bit#31) so cannot be an RGB value.

                Comment

                • Coolboy55
                  New Member
                  • Jul 2007
                  • 67

                  #9
                  Originally posted by NeoPa
                  Any of the negative numbers quoted so far are predefined constants and they are NOT RGB values.

                  As explained, an RGB value is constrained to the least significant 24 bits of a 32-bit value. Negative numbers, by definition, use the most significant bit (bit#31) so cannot be an RGB value.
                  Thanks again for the excellent information! I knew there had to be some conversion algorithm for the numbers, so here it is then!

                  Comment

                  • NeoPa
                    Recognized Expert Moderator MVP
                    • Oct 2006
                    • 32634

                    #10
                    No worries CB.

                    Glad it helped :)

                    Comment

                    Working...