Visual Basic - Codigo Innecesario ??

Life is soft - evento anual de software empresarial
 
Vista:

Codigo Innecesario ??

Publicado por Renzo (1 intervención) el 18/11/2007 19:55:18
Hola, tengo un codigo hecho en Visual Basic bien hecho que es de otra persona, pero existe un procedimiento que me parece innecesario. EL codigo completo es:

Option Explicit
Public Brojo, Bverde, Bazul As Integer
Public Frojo, Fverde, Fazul As Integer

Private Sub cmdSalir_Click()
End
End Sub

Private Sub Form_Load()
Brojo = 0
Bverde = 0
Bazul = 0
Frojo = 0
Fverde = 0
Fazul = 0
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(i).Text = hsbColor(i).Value
Next i
Else
lblCuadro.ForeColor = RGB(hsbColor(0).Value, hsbColor(1).Value, hsbColor(2).Value)
For i = 0 To 2
txtColor(i).Text = hsbColor(i).Value
Next i
End If
End Sub


Private Sub optColor_Click(Index As Integer)


If Index = 0 Then 'Se pasa a cambiar el fondo
Frojo = hsbColor(0).Value
Fverde = hsbColor(1).Value
Fazul = hsbColor(2).Value
hsbColor(0).Value = Brojo
hsbColor(1).Value = Bverde
hsbColor(2).Value = Bazul


Else 'Se pasa a cambiar el texto
Brojo = hsbColor(0).Value
Bverde = hsbColor(1).Value
Bazul = hsbColor(2).Value
hsbColor(0).Value = Frojo
hsbColor(1).Value = Fverde
hsbColor(2).Value = Fazul


End If
End Sub

---> MI PREGUNTA ES PARA QUE SIRVE EL PROCEDIMIENTO : Private Sub optColor_Click . Pues he probado el codigo sin ese procedimiento y funciona perfectamente . Ojala puedan ayudarme. Gracias.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder