Colors Pallette other than that available

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mohan Krishna
    New Member
    • Oct 2007
    • 115

    Colors Pallette other than that available

    Hi everyone

    Please help me in getting any other colors, which are not available in the VB 6 Color Pallette.

    Can we get any dll for that?
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Try to use RGB() function for the purpose.

    Comment

    • Mohan Krishna
      New Member
      • Oct 2007
      • 115

      #3
      Originally posted by debasisdas
      Try to use RGB() function for the purpose.
      Hi

      Thank you for your reply.
      Can we use the same for the form background and others?

      Thank you.
      Last edited by Killer42; Nov 13 '07, 06:46 AM.

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        you can use that for any control with any color property if the control supports.

        me.backcolor=rg b(255,50,100)

        Comment

        • Mohan Krishna
          New Member
          • Oct 2007
          • 115

          #5
          Originally posted by debasisdas
          you can use that for any control with any color property if the control supports.

          me.backcolor=rg b(255,50,100)
          Thank You very much!

          Comment

          • Mohan Krishna
            New Member
            • Oct 2007
            • 115

            #6
            Originally posted by Mohan Krishna
            Thank You very much!
            Can i use me.backcolor = RED ?

            If so, what reference should be given to the project?

            Please help me.

            Comment

            • Mohan Krishna
              New Member
              • Oct 2007
              • 115

              #7
              Hi

              I tried as me.backcolor = vbRed.

              Comment

              • Killer42
                Recognized Expert Expert
                • Oct 2006
                • 8429

                #8
                Originally posted by Mohan Krishna
                I tried as me.backcolor = vbRed.
                That should work.

                Comment

                • debasisdas
                  Recognized Expert Expert
                  • Dec 2006
                  • 8119

                  #9
                  You can also use QBcolor() for colors.

                  This function can receive values from 0 to 15 only. So it can produce 16 colors only.
                  3 primary colors,
                  3 secondary colors,
                  black,
                  white
                  and lighter shades of the the above 8 colors.
                  Last edited by Killer42; Nov 14 '07, 06:17 AM.

                  Comment

                  • Mohan Krishna
                    New Member
                    • Oct 2007
                    • 115

                    #10
                    Originally posted by debasisdas
                    You can also use QBcolor() for colors.

                    This function can receive values from 0 to 15 only. So it can produce 16 colors only.
                    3 primary colors,
                    3 secondary colors,
                    black,
                    white
                    and lighter shades of the the above 8 colors.
                    Thank You Sir!
                    Can I change the colors randomly other than (R G B) automatically in a form using Timer()

                    Code:
                    Private Sub Timer1_Timer()
                        If Me.BackColor = vbWhite Or Me.BackColor = vbYellow Then
                            Me.BackColor = vbRed
                         ElseIf Me.BackColor = vbRed Then
                            Me.BackColor = vbGreen
                        ElseIf Me.BackColor = vbGreen Then
                            Me.BackColor = vbBlue
                        Else                       'If Me.BackColor = vbGreen Then
                            Me.BackColor = vbYellow
                        End If
                    End Sub
                    Now can I change them randomly?
                    Please help me!

                    Comment

                    • Killer42
                      Recognized Expert Expert
                      • Oct 2006
                      • 8429

                      #11
                      Originally posted by Mohan Krishna
                      ...Can I change the colors randomly other than (R G B) automatically in a form using Timer()
                      All of these constants (vbWhite etc) and functions (RGB, QBColor, etc) are just returning numbers between 0 and 16777216. So if you want, simply use a random number in this range. If you have a look in the Articles area, we have some info on generating random numbers.

                      Comment

                      • Mohan Krishna
                        New Member
                        • Oct 2007
                        • 115

                        #12
                        Originally posted by Killer42
                        All of these constants (vbWhite etc) and functions (RGB, QBColor, etc) are just returning numbers between 0 and 16777216. So if you want, simply use a random number in this range. If you have a look in the Articles area, we have some info on generating random numbers.
                        Thank You!
                        I've seen the Code!

                        Comment

                        Working...