Results 1 to 5 of 5

Thread: Color Palette

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2002
    Location
    Mesa, Arizona
    Posts
    45

    Question Color Palette

    Hello all, How can I call up a color pallet in VB and is it easy to use?

  2. #2
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    Like the attached file maybe? Remember to reference the common dialog control.

  3. #3
    Member tc101's Avatar
    Join Date
    Oct 2006
    Posts
    63

    Re: Color Palette

    The link above no longer works. How do you add the color pallet to VB6?

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Color Palette

    Welcome to the forums.

    Use the .ShowColor method of the CommonDialog control
    VB Code:
    1. Private Sub cmdShowColor_Click
    2. CommonDialog1.ShowColor
    3. End Sub
    You will need, of course, to add a common dialog control to the form you want to run this on.

  5. #5
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Color Palette

    Have you noticed that this thread is 4 years old? Try this to actually retrieve the color:
    VB Code:
    1. On Error GoTo ErrorHandeler
    2.  
    3.     Dim someColor As Long
    4.    
    5.         With CommonDialog1
    6.             .CancelError = True
    7.             .ShowColor
    8.                 someColor = .Color
    9.                     Me.BackColor = someColor
    10.         End With
    11.  
    12.             Exit Sub
    13.            
    14. ErrorHandeler:

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