Estaba puesto arriba pero lo volveré a poner actualizado....
![Tongue :P](https://solocodigo.com/Smileys/solocodigo/tongue.gif)
Option Explicit
Public Brojo As Integer
Public Bverde As Integer
Public Bazul As Variant
Public FRojo As Integer
Public Fverde As Integer
Public Fazul As Variant
Private Sub cmdColores_Click()
Me.CommonDialog1.ShowColor
If optColor(0).Value = True Then
lblCuadro.BackColor = CommonDialog1.Color
Else
If optColor(1).Value = True Then
lblCuadro.ForeColor = CommonDialog1.Color
End If
End If
End Sub
Private Sub cmdSalir_Click()
End
End Sub
Private Sub Form_Load()
Brojo = 0
Bverde = 0
Bazul = 0
FRojo = 255
Fverde = 255
Fazul = 255
lblCuadro.BackColor = RGB(Brojo, Bverde, Bazul)
lblCuadro.ForeColor = RGB(FRojo, Fverde, Fazul)
End Sub
Private Sub hsbColor_Change(Index As Integer)
If optColor(0).Value = True Then
lblCuadro.BackColor = RGB(hsbColor(0).Value, hsbColor(1).Value, hsbColor(2).Value)
Dim i As Integer
For i = 0 To 2
txtColor(Index).Text = hsbColor(Index).Value
Next i
Else
lblCuadro.ForeColor = RGB(hsbColor(0).Value, hsbColor(1).Value, hsbColor(2).Value)
For i = 0 To 2
txtColor(Index).Text = hsbColor(Index).Value
Next i
End If
hsbColor(Index).Value = Val(txtColor(Index).Text)
End Sub
Private Sub optColor_Click(Index As Integer)
If Index = 0 Then
Brojo = hsbColor(0).Value
Bverde = hsbColor(1).Value
Bazul = hsbColor(2).Value
hsbColor(0).Value = FRojo
hsbColor(1).Value = Fverde
hsbColor(2).Value = Fazul
Else
FRojo = hsbColor(0).Value
Fverde = hsbColor(1).Value
Fazul = hsbColor(2).Value
hsbColor(0).Value = Brojo
hsbColor(1).Value = Bverde
hsbColor(2).Value = Bazul
End If
End Sub
Private Sub txtColor_Change(Index As Integer)
If Val(txtColor(Index).Text) > 255 Then
hsbColor(Index).Value = 255
End If
txtColor(Index).Text = Val(txtColor(Index).Text)
hsbColor(Index).Value = Val(txtColor(Index).Text)
End Sub