0

I want to do a form where the user can choose one of the predeterminated posible palettes to use in a Chart, how can i do that?

i don't want the user to pick color by color with the colorDialog, but to choose the entire palette. And if it is posible i want the form to show it like a continuous bar.

Thanks

lunicirus
  • 1
  • 1

1 Answers1

0

Well i searched a lot but didn't find it, even if it's very common in a lot of programs. Finally did it the really long way, i add the code to anyone that might interest.

Private cBerry() As Color = {Color.BlueViolet, Color.MediumOrchid, Color.RoyalBlue, Color.MediumVioletRed, Color.Blue, Color.BlueViolet, Color.Orchid, Color.MediumSlateBlue, Color.FromArgb(192, 0, 192), Color.MediumBlue, Color.Purple}
.
.
.
Private cPastel() As Color = {Color.SkyBlue, Color.LimeGreen, Color.MediumOrchid, Color.LightCoral, Color.SteelBlue, Color.YellowGreen, Color.Turquoise, Color.HotPink, Color.Khaki, Color.Tan, Color.DarkSeaGreen, Color.CornflowerBlue, Color.Plum, Color.CadetBlue, Color.PeachPuff, Color.LightSalmon}


cBerryLbls = {Label1, Label2, Label3, Label4, Label5, Label6, Label7, Label8, Label9, Label10, Label11}
.
.
.
cPastelLbls = {Label12, Label13, Label14, Label15, Label16, Label17, Label8, Label19, Label20, Label21, Label22, Label23, Label24, Label25, Label26, Label27}



labls = {cBerryLbls,... cPastelLbls}
colores = {cBerry,... cPastel}


Dim labs As Label()
Dim colori As Color()
For i As Integer = 0 To colores.Length - 1

   labs = labls(i)
   colori = colores(i)
   For j As Integer = 0 To labs.Length - 1

       labs(j).BackColor = colori(j)

   Next

Next
lunicirus
  • 1
  • 1