Está en la página 1de 17

 Insertamos un frame el cual le ponemos

el nombre (caption) colores.Dentro de el


insertamos cuatro option button, los
cuales le llamamos azul, rojo, verde y
amarillo.
 De nuevo insertamos otro frame y a este
le llamamos posicion, dentroinsertamos
dos option button con el nombre de
arriba y abajo.
 Tambien insertamos una label en el lugar
que le corresponde.
Control Propiedad Valor Control Propiedad Valor

frmColoresO Ñame frmColoresO optVerde Ñame optVerde

Caption Colores Caption Verde

fraColores Ñame fraColor fraPosicion Ñame fraPosicion

Caption Colores Caption Posición

optAzul Name optAzul optArriba Name optArriba

Caption Azul Caption Arriba

optRojo Name optRojo optAbajo Name optAbajo

Caption Rojo Caption Abajo

optAmarillo Name optAmarillo txtCaja Name txtCaja

Caption Amarillo Text “”


 Option Explicit
Private Sub Form_Load()
txtCaja.Top = 0
End Sub
 Private Sub optArriba_Click()
txtCaja.Top = 0
End Sub
 Private Sub optAbajo_Click()
txtCaja.Top =
frmColores0.ScaleHeight - txtCaja.Height
End Sub
 Private Sub optAzul_Click()
txtCaja.BackColor = vbBlue
End Sub
 Private Sub optRojo_Click()
txtCaja.BackColor = vbRed
End Sub
 Private Sub optVerde_Click()
txtCaja.BackColor = vbGreen
End Sub
 Private Sub optAmarillo_Click()
txtCaja.BackColor = vbYellow
End Sub
 Insertamos tres label para los numeros,
entre ellos ponemos dos text.
 Luego insertamos cuatro comandos
para los signos de operación
 Y les agregamos las siguientes
propiedades.
Control Propiedad Valor Control Propiedad Valor

frmMinicalc Name frmMinicalc lblEqual Name lblEqual

Caption Minicalculadora Caption =

txtOper1 Name txtOper1 cmdSuma Name cmdSuma

Text Caption +

txtOper2 Name txtOper2 cmdResta Name cmdResta

Text Caption -

txtResult Name txtResult cmdMulti Name cmdProd

Text Caption *

lblOp Name lblOp cmdDivi Name cmdDiv

Caption Caption /
 Option Explicit
Private Sub cmdDiv_Click()
txtResult.Text = Val(txtOper1.Text) / Val(txtOper2.Text)
lblOp.Caption = "/" End Sub
 Private Sub cmdProd_Click()
txtResult.Text = Val(txtOper1.Text) * Val(txtOper2.Text)
lblOp.Caption = "*" End Sub
 Private Sub cmdResta_Click()
txtResult.Text = Val(txtOper1.Text) - Val(txtOper2.Text)
lblOp.Caption = "-" End Sub
 Private Sub cmdSuma_Click()
txtResult.Text = Val(txtOper1.Text) + Val(txtOper2.Text)
lblOp.Caption = "+" End Sub
 Insertamos un vscroll en el centro del
formulario.
 Un comando para la opción salir
 Tambien ponemos dos text y debajo de
ellos insertamos dos label
Control Propiedad Valor Control Propiedad Valor

frmTemp Ñame frmTemp vsbTemp Ñame vsbTemp

Caption Conversor de Min 100


temperaturas

mnuFile Ñame mnuFile Max -100

Caption &File SmallChange 1

mnuFileExit Ñame mnuFileExit LargeChange 10

Caption E&xit Valué 0

cmdSalir Ñame cmdSalir lblCent Ñame lblCent

Caption Salir Caption Grados Centígrados

Font MS Sans Serif, Bold, 14 Font MS Sans Serif, 10

txtCent Name txtCent lblFahr Name lblFahr

text 0 Caption Grados Fahrenheit

txtFahr Name txtFahr Font MS Sans Serif, 10

text 32
 Private Sub cmbSalir_Click()
Beep
End End Sub
 Private Sub mnuFileExit_Click()
End End Sub
 Private Sub vsbTemp_Change()
txtCent.Text = vsbTemp.Value
txtFahr.Text = 32 + 1.8 * vsbTemp.Value End
Sub
Control Propiedad Valor Control Propiedad Valor

frmColores Name frmColores hsbColor Name hsbColor

Caption Colores Min 0

lblCuadro Name lblCuadro Max 255

Caption INFORMÁTICA 1 SmallChange 1

Font MS Sans Serif, Bold, 24 LargeChange 16

cmdSalir Name cmdSalir Index 0,1,2

Caption Salir Value 0

Font MS Sans Serif, Bold, 10 txtColor Name txtColor

optColor Name optColor Text 0

Index 0,1 Locked True

Caption Fondo, Texto Index 0,1,2

Font MS Sans Serif, Bold, 10 lblColor Name lblColor

Caption Rojo,Verde,Azul

Index 0,1,2

Font MS Sans Serif, 10


 Option Explicit
 Public Brojo, Bverde, Bazul As Integer
Public Frojo, Fverde, Fazul As Integer
Private Sub cmdSalir_Click()
End End Sub
C
Private Sub Form_Load()
Brojo =
O
0
Bverde D
=0
Bazul =
0
I
Frojo =
255
G
Fverde
= 255 O
Fazul =
255
lblCuadro.BackColor
S
lblCuadro.ForeColor
End Sub
 RGB(Brojo, Bverde, Bazul) RGB(Frojo, Fverde, Fazul)
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

También podría gustarte