Está en la página 1de 8

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
End If
Text ““
CheckBox Name nnNegrita
Caption &Negrita If nnMayusculas.Value = 1 Then
CheckBox Name nnCursiva nnTextoPrueba = UCase(nnTextoPrueba )
Caption &Cursiva Else
CheckBox Name nnMayúsculas nnTextoPrueba = LCase(nnTextoPrueba )
Caption &Mayúsculas
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 Else
efecto en el texto que se ha
introducido en la caja de texto” nnTextoPrueba.Font.Bold = False
CommandButtom Name nnSalir End If

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


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

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


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
End If
ListBox Name nnPaises
Columns 0 If nnPaises.ListIndex <> -1 Then
Sorted True nnPaises.RemoveItem nnPaises.ListIndex
Label Name nnLabel1 nnPaisSelec.Text = “ “
Caption Pais seleccionado
TextBox Name nnPaisSelec
End If
Text ““
CommandButtom Name nnAñadirElemento If nnPaises.ListIndex <> -1 Then
Caption Añadir nuevo elemento nnPaisSelec.Text = nnPaises.List(nnPaises.ListIndex)
CommandButtom Name nnEliminarElemento End If

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


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 If nnFrutas.ListIndex <> -1 Then
Ciruela
Fresa nnFrutas.RemoveItem nnFrutas.ListIndex
Lúcuma nnFrutaSelec.Text = ""
Manzana End If
Damasco
Mandarina If nnFrutas.ListIndex <> -1 Then
Naranja
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
Caption Añadir nuevo elemento ‘Al modificar texto debe reflejarse en combo
CommandButtom Name nnEliminarElemento nnFrutas.Text = nnFrutaSelec.Text

Ing. Hermas Herrera Callejas Página : 4 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

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


Ing. Hermas Herrera Callejas Página : 6 de 4
HscrollBar Name nnAzul
LargeChange 10
Max 255
Min 0
SmallChange 2
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)
Control Propiedad Valor
‘ En nnAzul para change y scroll
PictureBox Name nnColores Text3.Text = nnAzul.Value

Label Caption Rojo ‘En nnRojo para change y scroll


Label Caption Verde Text1.Text = nnRojo.Value
Label Caption Azul
‘ En nnVerde para change y scroll
HscrollBar Name nnRojo Text2.Text = nnVerde.Value
LargeChange 10
Max 255 ‘Para Suceso click en nnColores
Min 0 ‘ Previamente se debe lograr el color del formulario
SmallChange 2 nnColores.BackColor = RGB(240, 235, 219)
Value 0
‘Para Suceso doble click en nnColores
HscrollBar Name nnVerde nnColores.BackColor = RGB(nnRojo.Value, nnVerde.Value,
LargeChange 10 nnAzul.Value)
Max 255
Min 0
SmallChange 2
Value 0

Ing. Hermas Herrera Callejas Página : 7 de


4
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

‘Con doble click despliega el menú contextual


PopupMenu nnFormato
Control Propiedad Valor
TextBox Name nnTexto1
Text “ “

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
&Salir nnSalir
&Varios nnVarios
&Reloj nnReloj
&Calculadora nnCalculadora
&Naipes nnNaipes

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

También podría gustarte