return color

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
5 posts Page 1 of 1
Contributors
User avatar
XTechVB
VIP - Site Partner
VIP - Site Partner
Posts: 727
Joined: Thu May 20, 2010 10:32 am

return color
XTechVB
i'm making a custom color dialog and i cant seem to find a way to return the selected color.

i need some kind of function like the the one in the standard color dialog(label1.forecolor = StandardColorDialog.SelectedColor)
so any help would be appreciated
Last edited by XTechVB on Sun Jun 03, 2012 12:35 pm, edited 1 time in total.
You can find me on Facebook or on Skype mihai_92b
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

Re: return color
AnoPem
This should do
Code: Select all
ColorDialog1.ShowDialog()
        PictureBox1.BackColor = ColorDialog1.Color
https://t.me/pump_upp
User avatar
XTechVB
VIP - Site Partner
VIP - Site Partner
Posts: 727
Joined: Thu May 20, 2010 10:32 am

Re: return color
XTechVB
AnoPem wrote:
This should do
Code: Select all
ColorDialog1.ShowDialog()
        PictureBox1.BackColor = ColorDialog1.Color
i need a function like the "SelectedColor" in the standard color dialog
You can find me on Facebook or on Skype mihai_92b
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: return color
mandai
You can use Color.FromArgb to create your own color values.
User avatar
MrAksel
C# Coder
C# Coder
Posts: 1758
Joined: Fri Mar 26, 2010 12:27 pm

Re: return color
MrAksel
Add a property in your custom dialog.
Code: Select all
Public Property SelectedColor As Color
When the user changes his/her choice, update the selected with this code:
Code: Select all
SelectedColor = NewColor
When your dialog closes, you can use
Code: Select all
Form1.BackColor = MyCustomColorDialog.SelectedColor
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;


Over 30 projects with source code!
Please give reputation to helpful members!

Image
Image
5 posts Page 1 of 1
Return to “Coding Help & Support”