Está en la página 1de 4

Caption Salir

Código: (01) Verificación

If nnColorRojo.Value = 1 Then
nnTextoPrueba.ForeColor = RGB(255, 0, 0)
Else
nnTextoPrueba.ForeColor = RGB(0, 0, 0)
End If

If nnCursiva.Value = 1 Then
nnTextoPrueba.Font.Italic = True
Else
Control Propiedad Valor nnTextoPrueba.Font.Italic = False
TextBox Name nnTextoPrueba
Text ““ End If
CheckBox Name nnNegrita
Caption &Negrita If nnMayusculas.Value = 1 Then
CheckBox Name nnCursiva nnTextoPrueba = UCase(nnTextoPrueba )
Caption &Cursiva Else
CheckBox Name nnMayúsculas
Caption &Mayúsculas nnTextoPrueba = LCase(nnTextoPrueba )
CheckBox Name nnColorRojo End If
Caption Color &Rojo
Label Name Label1 If nnNegrita.Value = 1 Then
Caption “Seleccione una o más casillas nnTextoPrueba.Font.Bold = True
de verificación para ver su
efecto en el texto que se ha Else
introducido en la caja de texto” nnTextoPrueba.Font.Bold = False
CommandButtom Name nnSalir End If
mismo”
CommandButtom Name nnSalir
Caption Salir
Frame Name nnFrame2
Caption Color Letras
OptionButton Name nnNegro
Caption Negro
OptionButton Name nnRojo
Caption Rojo
OptionButton Name nnVerde
Caption Verde
OptionButton Name nnAzul
Caption Azul

Código (02) Opciones

Control Propiedad Valor RGB(Rojo%, Verde%, Azul%)


TextBox Name nnTexto1
Text ““ If nnNegro.Value = True Then
Frame Name nnFrame1
Caption Tamaño Letras nnTexto1.ForeColor = RGB(0, 0, 0)
OptionButton Name nnTamaño8 End If
Caption 8
OptionButton Name nnTamaño10
Caption 10 If nnRojo.Value = True Then
OptionButton Name nnTamaño12 nnTexto1.ForeColor = RGB(255, 0, 0)
Caption 12 End If
OptionButton Name nnTamaño14
Caption 14
Label Name Label1 If nnTamaño8.Value = True Then
Caption “Introduzca un texto de prueba en nnTexto1.FontSize = 8
el recuadro anterior y luego selec-
cione un tamaño y un color para el End If

Ing. Hermas Herrera Callejas Página : 1 de 4


CommandButtom Name nnEliminarElemento
Caption Eliminar elemento
CommandButtom Name nnSalir
Caption Salir
Código (03) Lista Simple

Dim nnElementoNuevo As String


nnElementoNuevo =
InputBox("Ingrese un nuevo País:", "Nuevo País")

If Len(Trim(nnElementoNuevo)) > 0 Then


nnPaises.AddItem nnElementoNuevo
Control Propiedad Valor
ListBox Name nnPaises
End If
Columns 0
Sorted True If nnPaises.ListIndex <> -1 Then
Label Name nnLabel1 nnPaises.RemoveItem nnPaises.ListIndex
Caption Pais seleccionado nnPaisSelec.Text = “ “
TextBox Name nnPaisSelec
Text ““
End If
CommandButtom Name nnAñadirElemento
Caption Añadir nuevo element If nnPaises.ListIndex <> -1 Then
nnPaisSelec.Text = nnPaises.List(nnPaises.ListIndex)
End If
Caption Eliminar elemento
CommandButtom Name nnSalir
Caption Salir

Código (04) Lista Combo

Dim nnElementoNuevo As String


nnElementoNuevo =
InputBox("Ingrese un nueva Fruta:", "Nueva Fruta")

If Len(Trim(nnElementoNuevo)) > 0 Then


nnFrutas.AddItem nnElementoNuevo
Control Propiedad Valor End If
ComboBox Name nnFrutas
List Chirimoya
Ciruela If nnFrutas.ListIndex <> -1 Then
Fresa nnFrutas.RemoveItem nnFrutas.ListIndex
Lúcuma nnFrutaSelec.Text = ""
Manzana End If
Damasco
Mandarina
Naranja
If nnFrutas.ListIndex <> -1 Then
Higo nnFrutaSelec.Text = nnfrutas.List(nnfrutas.ListIndex)
Sorted True Else
Style 1-Simple Combo nnFrutaSelec.Text = ""
Text “ “ End If
Label Name nnLabel1
Caption Fruta seleccionada
TextBox Name nnFrutaSelec ‘Al modificar combo debe reflejarse en texto
Text “ “ nnFrutaSelec.Text = nnFrutas.Text
CommandButtom Name nnAñadirElemento ‘Al modificar texto debe reflejarse en combo
Caption Añadir nuevo elemento nnFrutas.Text = nnFrutaSelec.Text
CommandButtom Name nnEliminarElemento

Ing. Hermas Herrera Callejas Página : 2 de 4


Código (05) Reloj
‘Definiciòn de variable pùblica
Public Contador As Integer
‘Cuando se carga el formulario
Control Propiedad Valor
Contador = 0
Form Caption “Reloj Digital Intermitente”
‘Para el suceso Timer de nnTimer1
Label Name nnHora
If nnHora.Tag = "Mostrar" Then
Alignment 2-Center
nnHora.Caption = Time$
Caption ““
nnHora.Tag = ""
Font Arial, Negrita, 18 puntos
Else
Tag “Mostrar ”
nnHora.Caption = ""
Timer Name nnTimer1
nnHora.Tag = "Mostrar"
Interval 500
End If
Enabled True
‘Para suceso Timer de nnTimer2
Timer Name nnTimer2
Contador = Contador + 5
Interval 5000
Form1.Caption = "Van " & Contador & " segundos"
Enabled True

Value 0
TextBox Name nnText1
Text “”
TextBox Name nnText2
Text “”
TextBox Name nnText3
Text “”

Código (06) Barras

‘ En cada barra de desplazamiento, para change y scroll


nnColores.BackColor = RGB(nnRojo.Value, nnVerde.Value,
nnAzul.Value)

‘ En nnAzul para change y scroll


Text3.Text = nnAzul.Value

‘En nnRojo para change y scroll


Control Propiedad Valor Text1.Text = nnRojo.Value
PictureBox Name nnColores
Label Caption Rojo ‘ En nnVerde para change y scroll
Label Caption Verde Text2.Text = nnVerde.Value
Label Caption Azul
HscrollBar Name nnRojo ‘Para Suceso click en nnColores
LargeChange 10 ‘ Previamente se debe lograr el color del formulario
Max 255 nnColores.BackColor = RGB(240, 235, 219)
Min 0
SmallChange 2 ‘Para Suceso doble click en nnColores
Value 0 nnColores.BackColor = RGB(nnRojo.Value, nnVerde.Value,
HscrollBar Name nnVerde nnAzul.Value)
LargeChange 10
Max 255
Min 0
SmallChange 2
Value 0
HscrollBar Name nnAzul
LargeChange 10
Max 255
Min 0
SmallChange 2
Ing. Hermas Herrera Callejas Página : 3 de 4
&Salir nnSalir
&Varios nnVarios
&Reloj nnReloj

&Calculadora nnCalculadora
&Naipes nnNaipes
Código (07) Menús

‘Cambia a Arial el tipo de letra del texto


nnTexto1.FontName = "Arial"

‘Cambia a Courier el tipo de letra del texto


nnTexto1.FontName = "Courier"

‘Cambia a Comic Sans MS el tipo de letra del texto


nnTexto1.FontName = "Comic Sans MS"

‘Cambia a 10 el tamaño de letra del texto


nnTexto1.FontSize = 10

‘Cambia a 12 el tamaño de letra del texto


nnTexto1.FontSize = 12

‘Cambia a 14 el tamaño de letra del texto


nnTexto1.FontSize = 14

‘Inicia el programa de la calculadora


id = Shell("C:\Windows\calc.exe", 1)

‘Inicia el programa del juego de solitario


id = Shell("C:\Windows\Sol.exe", 1)

‘Inicia el programa ejecutable del reloj


id = Shell("F:\Hhc\VSBasic2003\nn05Reloj.exe", 1)

‘Termina el programa
End
Control Propiedad Valor
TextBox Name nnTexto1 ‘Con doble click despliega el menú contextual
Text “ “ PopupMenu nnFormato

Caption Name Shortcut


&Formato nnFormato
F&uente nnFuente
Arial nnFuenteArial Ctrl + A
Comic Sans MS nnFuenteComicSans Ctrl + C
Courier nnFuenteCourier Ctrl + O
&Tamaño nnTamaño
10 nnTamaño10
12 nnTamaño12
14 nnTamaño14
- LineaSeparadora
Ing. Hermas Herrera Callejas Página : 4 de 4

También podría gustarte