Você está na página 1de 4

Cdigo: (01) Verificacin

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

Control
TextBox
CheckBox
CheckBox
CheckBox
CheckBox
Label

Propiedad
Name
Text
Name
Caption
Name
Caption
Name
Caption
Name
Caption
Name
Caption

CommandButtom Name

Caption

Valor
nnTextoPrueba

nnNegrita
&Negrita
nnCursiva
&Cursiva
nnMaysculas
&Maysculas
nnColorRojo
Color &Rojo
Label1
Seleccione una o ms casillas
de verificacin para ver su
efecto en el texto que se ha
introducido en la caja de texto
nnSalir
Salir

If nnCursiva.Value = 1 Then
nnTextoPrueba.Font.Italic = True
Else
nnTextoPrueba.Font.Italic = False
End If
If nnMayusculas.Value = 1 Then
nnTextoPrueba = UCase(nnTextoPrueba )
Else
nnTextoPrueba = LCase(nnTextoPrueba )
End If
If nnNegrita.Value = 1 Then
nnTextoPrueba.Font.Bold = True
Else
nnTextoPrueba.Font.Bold = False
End If
CommandButtom Name
Caption
Frame
Name
Caption
OptionButton
Name
Caption
OptionButton
Name
Caption
OptionButton
Name
Caption
OptionButton
Name
Caption

nnSalir
Salir
nnFrame2
Color Letras
nnNegro
Negro
nnRojo
Rojo
nnVerde
Verde
nnAzul
Azul

Cdigo (02) Opciones


Control
TextBox
Frame
OptionButton
OptionButton
OptionButton
OptionButton
Label

Propiedad
Name
Text
Name
Caption
Name
Caption
Name
Caption
Name
Caption
Name
Caption
Name
Caption

Ing. Hermas Herrera Callejas

Valor
nnTexto1

nnFrame1
Tamao Letras
nnTamao8
8
nnTamao10
10
nnTamao12
12
nnTamao14
14
Label1
Introduzca un texto de prueba en
el recuadro anterior y luego seleccione un tamao y un color para el
mismo

RGB(Rojo%, Verde%, Azul%)


If nnNegro.Value = True Then
nnTexto1.ForeColor = RGB(0, 0, 0)
End If
If nnRojo.Value = True Then
nnTexto1.ForeColor = RGB(255, 0, 0)
End If
If nnTamao8.Value = True Then
nnTexto1.FontSize = 8
End If

Pgina : 1 de 4

CommandButtom Name
Caption

nnSalir
Salir

Cdigo (03) Lista Simple


Dim nnElementoNuevo As String
nnElementoNuevo =
InputBox("Ingrese un nuevo Pas:", "Nuevo Pas")
If Len(Trim(nnElementoNuevo)) > 0 Then
nnPaises.AddItem nnElementoNuevo
End If
Control
ListBox

Propiedad
Name
Columns
Sorted
Label
Name
Caption
TextBox
Name
Text
CommandButtom Name
Caption
CommandButtom Name
Caption

Valor
nnPaises
0
True
nnLabel1
Pais seleccionado
nnPaisSelec

nnAadirElemento
Aadir nuevo elemento
nnEliminarElemento
Eliminar elemento

If nnPaises.ListIndex <> -1 Then


nnPaises.RemoveItem nnPaises.ListIndex
nnPaisSelec.Text =
End If
If nnPaises.ListIndex <> -1 Then
nnPaisSelec.Text = nnPaises.List(nnPaises.ListIndex)
End If
CommandButtom

Name
Caption

nnSalir
Salir

Cdigo (04) Lista Combo


Dim nnElementoNuevo As String
nnElementoNuevo =
InputBox("Ingrese un nueva Fruta:", "Nueva Fruta")
If Len(Trim(nnElementoNuevo)) > 0 Then
nnFrutas.AddItem nnElementoNuevo
End If
Control
ComboBox

Propiedad
Name
List

Sorted
Style
Text
Label
Name
Caption
TextBox
Name
Text
CommandButtom Name
Caption
CommandButtom Name
Caption

Ing. Hermas Herrera Callejas

Valor
nnFrutas
Chirimoya
Ciruela
Fresa
Lcuma
Manzana
Damasco
Mandarina
Naranja
Higo
True
1-Simple Combo

nnLabel1
Fruta seleccionada
nnFrutaSelec

nnAadirElemento
Aadir nuevo elemento
nnEliminarElemento
Eliminar elemento

If nnFrutas.ListIndex <> -1 Then


nnFrutas.RemoveItem nnFrutas.ListIndex
nnFrutaSelec.Text = ""
End If
If nnFrutas.ListIndex <> -1 Then
nnFrutaSelec.Text = nnfrutas.List(nnfrutas.ListIndex)
Else
nnFrutaSelec.Text = ""
End If
Al modificar combo debe reflejarse en texto
nnFrutaSelec.Text = nnFrutas.Text
Al modificar texto debe reflejarse en combo
nnFrutas.Text = nnFrutaSelec.Text

Pgina : 2 de 4

Control
Form
Label

Timer

Timer

Propiedad
Caption
Name
Alignment
Caption
Font
Tag
Name
Interval
Enabled
Name
Interval
Enabled

Valor
Reloj Digital Intermitente
nnHora
2-Center

Arial, Negrita, 18 puntos


Mostrar
nnTimer1
500
True
nnTimer2
5000
True

Cdigo (05) Reloj


Definicin de variable pblica
Public Contador As Integer
Cuando se carga el formulario
Contador = 0
Para el suceso Timer de nnTimer1
If nnHora.Tag = "Mostrar" Then
nnHora.Caption = Time$
nnHora.Tag = ""
Else
nnHora.Caption = ""
nnHora.Tag = "Mostrar"
End If
Para suceso Timer de nnTimer2
Contador = Contador + 5
Form1.Caption = "Van " & Contador & " segundos"

TextBox
TextBox
TextBox

LargeChange
Max
Min
SmallChange
Value
Name
Text
Name
Text
Name
Text

10
255
0
2
0
nnText1

nnText2

nnText3

Cdigo (06) Barras


En cada barra de desplazamiento, para change y scroll
nnColores.BackColor = RGB(nnRojo.Value, nnVerde.Value,
nnAzul.Value)
Control

Propiedad

Valor

PictureBox

Name

nnColores

Label
Label
Label

Caption
Caption
Caption

Rojo
Verde
Azul

HscrollBar

Name
LargeChange
Max
Min
SmallChange
Value

nnRojo
10
255
0
2
0

HscrollBar

Name
LargeChange
Max
Min
SmallChange
Value

nnVerde
10
255
0
2
0

HscrollBar

Name

nnAzul

Ing. Hermas Herrera Callejas

En nnAzul para change y scroll


Text3.Text = nnAzul.Value
En nnRojo para change y scroll
Text1.Text = nnRojo.Value
En nnVerde para change y scroll
Text2.Text = nnVerde.Value
Para Suceso click en nnColores
Previamente se debe lograr el color del formulario
nnColores.BackColor = RGB(240, 235, 219)
Para Suceso doble click en nnColores
nnColores.BackColor = RGB(nnRojo.Value, nnVerde.Value,
nnAzul.Value)

Pgina : 3 de 4

Cdigo (07) Mens


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 tamao de letra del texto
nnTexto1.FontSize = 10
Cambia a 12 el tamao de letra del texto
nnTexto1.FontSize = 12
Cambia a 14 el tamao 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
TextBox

Propiedad
Name
Text

Valor
nnTexto1

Caption

Name

Shortcut

&Formato
F&uente
Arial
Comic Sans MS
Courier
&Tamao
10
12
14
&Salir
&Varios
&Reloj
&Calculadora
&Naipes

nnFormato
nnFuente
nnFuenteArial
nnFuenteComicSans
nnFuenteCourier
nnTamao
nnTamao10
nnTamao12
nnTamao14
LineaSeparadora
nnSalir
nnVarios
nnReloj
nnCalculadora
nnNaipes

Ing. Hermas Herrera Callejas

Ctrl + A
Ctrl + C
Ctrl + O

Pgina : 4 de 4

Você também pode gostar