944,171 Members | Top Members by Rank

Ad:
Aug 13th, 2007
0

Add color palette to form

Expand Post »
I'd like to add a color palette to my form, so that the user can choose a color. How can I add such a palette to my form(with all the colors vb offers)?
Similar Threads
Reputation Points: 10
Solved Threads: 16
Posting Whiz in Training
plusplus is offline Offline
207 posts
since Jul 2007
Aug 13th, 2007
0

Re: Add color palette to form

Hi,
Add this Control to ur ToolBox:
"Microsoft Commom Dialog Control 6.0" to ur Project. Place the Control on the Form and rename it as "cdlg"
and use this Code:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Command1_Click()
  2. Dim mycol
  3. cdlg.ShowColor
  4. mycol = cdlg.Color
  5. Me.BackColor = mycol
  6. End Sub

Regards
Veena
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Aug 13th, 2007
0

Re: Add color palette to form

Two questions
1. I'd like to also add the system colors
2. How to move the palette to a certain place on the screen?
Reputation Points: 10
Solved Threads: 16
Posting Whiz in Training
plusplus is offline Offline
207 posts
since Jul 2007
Aug 15th, 2007
0

Re: Add color palette to form

Hi,

U cannot Control the position of CommonDialog control. But there is an alternative, Place the common Dialog on a New Form, and Move the Form to Desired position on Screen and Show the Form.

Some thing like this : Add a Form And Rename it as frmColor:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Dim frmColor As New frmColor
  2. frmColor.Move 200,500
  3. frmColor.cdlg.ShowColor

Not very sure abt system colors...

Regards
Veena
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Aug 15th, 2007
0

Re: Add color palette to form

Thanks,works great
Reputation Points: 10
Solved Threads: 16
Posting Whiz in Training
plusplus is offline Offline
207 posts
since Jul 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: need help...
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Listview generates Devision by zero Error When reordering Columns





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC