SlideShare una empresa de Scribd logo
Ejercicios de visual
Ejercicios de visual
 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
Ejercicios de visual
 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
Ejercicios de visual
 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
Ejercicios de visual
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

Más contenido relacionado

PPTX
Practicas
PPTX
Ejercicios de visual
PDF
Guia no4 ado.net
DOCX
DOCX
DOCX
iNDICE DE CONTENIDOS
DOC
Investigacion 1
ODP
Python básico
Practicas
Ejercicios de visual
Guia no4 ado.net
iNDICE DE CONTENIDOS
Investigacion 1
Python básico

La actualidad más candente (16)

PPTX
Cadenas
PDF
Practicas Visual Basic 6.0
PDF
Ejercicios resueltos con Python
PDF
Guion scripts
PDF
Ejercicios en Python
PPT
Python05
DOCX
Actividad Obligatoria N°1 - Intro. a la Informática
PPT
Python04
PPT
Python03
PDF
Curso de Python
PDF
Introduccion a Python. Clase 1
PDF
Cuaderno visual basic
PPT
8 herramientas de procesos de string
PPT
8 herramientas de procesos de string
DOCX
02 introduccion a python
PPT
Python02
Cadenas
Practicas Visual Basic 6.0
Ejercicios resueltos con Python
Guion scripts
Ejercicios en Python
Python05
Actividad Obligatoria N°1 - Intro. a la Informática
Python04
Python03
Curso de Python
Introduccion a Python. Clase 1
Cuaderno visual basic
8 herramientas de procesos de string
8 herramientas de procesos de string
02 introduccion a python
Python02
Publicidad

Destacado (17)

PPTX
A comparative look at development-oriented degrees in the St. Cloud Area
PPTX
Ford Field
PPTX
Apresentação de bijuterias
PDF
Php exceptions
PPTX
Jamie Bergsman Powerpoint
PPTX
Salesforce Mobile Developer Week Meetup karachi
PPTX
DOCX
Tulisan 1
PDF
Ambito sociosanitario
PPTX
Virtuális teamek
PPTX
Ejercicios de visual
PPT
1st karachi salesforce platform dug meetup
PDF
Blog Pro 2.0 User Guide
DOCX
Buku iiia-borang-akreditasi-d4-pjj-2012 rev-copy2
PDF
Php tests tips
PPTX
Automated tests
PPTX
Virtuális teamek
A comparative look at development-oriented degrees in the St. Cloud Area
Ford Field
Apresentação de bijuterias
Php exceptions
Jamie Bergsman Powerpoint
Salesforce Mobile Developer Week Meetup karachi
Tulisan 1
Ambito sociosanitario
Virtuális teamek
Ejercicios de visual
1st karachi salesforce platform dug meetup
Blog Pro 2.0 User Guide
Buku iiia-borang-akreditasi-d4-pjj-2012 rev-copy2
Php tests tips
Automated tests
Virtuális teamek
Publicidad

Similar a Ejercicios de visual (20)

PDF
Cuaderno visual basic
PDF
Cuaderno visual basic
DOCX
Guia 1 visual
PPTX
Diapo margarita
PPTX
Diapo margarita
PPTX
Diapo margarita
PPTX
Presentacion de margarita en corto
PPTX
Presentacion de las practicas
PPT
Practicas de visual basic 6.0
PPT
Practicas de visual basic 6.0
PPT
Practicas
PPT
Manual de practicas
PPT
Practicas de visual basic 6.0
PPT
Practicas de visual basic 6.0
PPT
Practicas
PPT
Practicas 2 unidad
PDF
Cristinagananparedes
PPTX
Procedimientos visual
PPT
Manual practicas
PDF
Cuaderno visual basic
Cuaderno visual basic
Guia 1 visual
Diapo margarita
Diapo margarita
Diapo margarita
Presentacion de margarita en corto
Presentacion de las practicas
Practicas de visual basic 6.0
Practicas de visual basic 6.0
Practicas
Manual de practicas
Practicas de visual basic 6.0
Practicas de visual basic 6.0
Practicas
Practicas 2 unidad
Cristinagananparedes
Procedimientos visual
Manual practicas

Ejercicios de visual

  • 3.  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.
  • 4. 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 “”
  • 5.  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
  • 7.  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.
  • 8. 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 /
  • 9.  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
  • 11.  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
  • 12. 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
  • 13.  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
  • 15. 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
  • 16. 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
  • 17. 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