Codigo en visual basic, definir colores
Enviado por perh1992 • 7 de Septiembre de 2015 • Práctica o problema • 656 Palabras (3 Páginas) • 460 Visitas
Public Class Form1
Private Sub lscolor_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lscolor.SelectedIndexChanged
Select Case lscolor.SelectedIndex
Case 0
txtcadena.ForeColor = Color.Black
Case 1
txtcadena.ForeColor = Color.Yellow
Case 2
txtcadena.ForeColor = Color.Green
Case 3
txtcadena.ForeColor = Color.Blue
Case 4
txtcadena.ForeColor = Color.Red
Case 5
txtcadena.ForeColor = Color.Brown
Case 6
txtcadena.ForeColor = Color.Pink
Case 7
txtcadena.ForeColor = Color.Gray
End Select
End Sub
Private Sub cmb1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmb1.SelectedIndexChanged
Select Case cmb1.SelectedIndex
Case 0
txtcadena.Font = New Font("microsoft sans serif", 8, FontStyle.Bold)
Case 1
txtcadena.Font = New Font("microsoft sans serif", 12, FontStyle.Bold)
Case 2
txtcadena.Font = New Font("microsoft sans serif", 14, FontStyle.Bold)
Case 3
txtcadena.Font = New Font("microsoft sans serif", 16, FontStyle.Bold)
Case 4
txtcadena.Font = New Font("microsoft sans serif", 20, FontStyle.Bold)
Case 5
txtcadena.Font = New Font("microsoft sans serif", 22, FontStyle.Bold)
Case 6
txtcadena.Font = New Font("microsoft sans serif", 24, FontStyle.Bold)
Case 7
txtcadena.Font = New Font("microsoft sans serif", 26, FontStyle.Bold)
Case 8
txtcadena.Font = New Font("microsoft sans serif", 28, FontStyle.Bold)
End Select
...