SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt? (16)

Cadenas
CadenasCadenas
Cadenas
 
Practicas Visual Basic 6.0
Practicas Visual Basic 6.0Practicas Visual Basic 6.0
Practicas Visual Basic 6.0
 
Ejercicios resueltos con Python
Ejercicios resueltos con PythonEjercicios resueltos con Python
Ejercicios resueltos con Python
 
Guion scripts
Guion scriptsGuion scripts
Guion scripts
 
Ejercicios en Python
Ejercicios en PythonEjercicios en Python
Ejercicios en Python
 
Python05
Python05Python05
Python05
 
Actividad Obligatoria N°1 - Intro. a la Informática
Actividad Obligatoria N°1 - Intro. a la InformáticaActividad Obligatoria N°1 - Intro. a la Informática
Actividad Obligatoria N°1 - Intro. a la Informática
 
Python04
Python04Python04
Python04
 
Python03
Python03Python03
Python03
 
Curso de Python
Curso de PythonCurso de Python
Curso de Python
 
Introduccion a Python. Clase 1
Introduccion a Python. Clase 1Introduccion a Python. Clase 1
Introduccion a Python. Clase 1
 
Cuaderno visual basic
Cuaderno visual basicCuaderno visual basic
Cuaderno visual basic
 
8 herramientas de procesos de string
8  herramientas de procesos de string8  herramientas de procesos de string
8 herramientas de procesos de string
 
8 herramientas de procesos de string
8  herramientas de procesos de string8  herramientas de procesos de string
8 herramientas de procesos de string
 
02 introduccion a python
02 introduccion a python02 introduccion a python
02 introduccion a python
 
Python02
Python02Python02
Python02
 

Andere mochten auch

A comparative look at development-oriented degrees in the St. Cloud Area
A comparative look at development-oriented degrees in the St. Cloud AreaA comparative look at development-oriented degrees in the St. Cloud Area
A comparative look at development-oriented degrees in the St. Cloud Areastephen.woods
 
Apresentação de bijuterias
Apresentação de bijuteriasApresentação de bijuterias
Apresentação de bijuteriasPatyBijus
 
Jamie Bergsman Powerpoint
Jamie Bergsman PowerpointJamie Bergsman Powerpoint
Jamie Bergsman Powerpointbergsmanj
 
Salesforce Mobile Developer Week Meetup karachi
Salesforce Mobile Developer Week Meetup karachiSalesforce Mobile Developer Week Meetup karachi
Salesforce Mobile Developer Week Meetup karachiMuhammad Salman Zafar
 
Virtuális teamek
Virtuális teamekVirtuális teamek
Virtuális teamekpeterhari
 
Ejercicios de visual
Ejercicios de visualEjercicios de visual
Ejercicios de visualmagda_chivas_
 
1st karachi salesforce platform dug meetup
1st karachi salesforce platform dug meetup1st karachi salesforce platform dug meetup
1st karachi salesforce platform dug meetupMuhammad Salman Zafar
 
Blog Pro 2.0 User Guide
Blog Pro 2.0 User GuideBlog Pro 2.0 User Guide
Blog Pro 2.0 User GuideIgor Goltsov
 
Buku iiia-borang-akreditasi-d4-pjj-2012 rev-copy2
Buku iiia-borang-akreditasi-d4-pjj-2012 rev-copy2Buku iiia-borang-akreditasi-d4-pjj-2012 rev-copy2
Buku iiia-borang-akreditasi-d4-pjj-2012 rev-copy2Muhammad Iqbal
 
Virtuális teamek
Virtuális teamekVirtuális teamek
Virtuális teamekpeterhari
 

Andere mochten auch (17)

A comparative look at development-oriented degrees in the St. Cloud Area
A comparative look at development-oriented degrees in the St. Cloud AreaA comparative look at development-oriented degrees in the St. Cloud Area
A comparative look at development-oriented degrees in the St. Cloud Area
 
Ford Field
Ford FieldFord Field
Ford Field
 
Apresentação de bijuterias
Apresentação de bijuteriasApresentação de bijuterias
Apresentação de bijuterias
 
Php exceptions
Php exceptionsPhp exceptions
Php exceptions
 
Jamie Bergsman Powerpoint
Jamie Bergsman PowerpointJamie Bergsman Powerpoint
Jamie Bergsman Powerpoint
 
Salesforce Mobile Developer Week Meetup karachi
Salesforce Mobile Developer Week Meetup karachiSalesforce Mobile Developer Week Meetup karachi
Salesforce Mobile Developer Week Meetup karachi
 
Fetus
FetusFetus
Fetus
 
Tulisan 1
Tulisan 1Tulisan 1
Tulisan 1
 
Ambito sociosanitario
Ambito sociosanitarioAmbito sociosanitario
Ambito sociosanitario
 
Virtuális teamek
Virtuális teamekVirtuális teamek
Virtuális teamek
 
Ejercicios de visual
Ejercicios de visualEjercicios de visual
Ejercicios de visual
 
1st karachi salesforce platform dug meetup
1st karachi salesforce platform dug meetup1st karachi salesforce platform dug meetup
1st karachi salesforce platform dug meetup
 
Blog Pro 2.0 User Guide
Blog Pro 2.0 User GuideBlog Pro 2.0 User Guide
Blog Pro 2.0 User Guide
 
Buku iiia-borang-akreditasi-d4-pjj-2012 rev-copy2
Buku iiia-borang-akreditasi-d4-pjj-2012 rev-copy2Buku iiia-borang-akreditasi-d4-pjj-2012 rev-copy2
Buku iiia-borang-akreditasi-d4-pjj-2012 rev-copy2
 
Php tests tips
Php tests tipsPhp tests tips
Php tests tips
 
Automated tests
Automated testsAutomated tests
Automated tests
 
Virtuális teamek
Virtuális teamekVirtuális teamek
Virtuális teamek
 

Ähnlich wie Ejercicios de visual

Ähnlich wie Ejercicios de visual (19)

Cuaderno visual basic
Cuaderno visual basicCuaderno visual basic
Cuaderno visual basic
 
Cuaderno visual basic
Cuaderno visual basicCuaderno visual basic
Cuaderno visual basic
 
Guia 1 visual
Guia 1 visualGuia 1 visual
Guia 1 visual
 
Procedimientos visual
Procedimientos visualProcedimientos visual
Procedimientos visual
 
Presentación1
Presentación1Presentación1
Presentación1
 
Presentación1
Presentación1Presentación1
Presentación1
 
Presentación1
Presentación1Presentación1
Presentación1
 
Presentación1
Presentación1Presentación1
Presentación1
 
Visual basic
Visual basicVisual basic
Visual basic
 
c#
c#c#
c#
 
Presentacion Visual Basic - SAIA B
Presentacion Visual Basic - SAIA BPresentacion Visual Basic - SAIA B
Presentacion Visual Basic - SAIA B
 
Comandos
ComandosComandos
Comandos
 
Lenguaje latino
Lenguaje latinoLenguaje latino
Lenguaje latino
 
Diccionario visual basic
Diccionario visual basicDiccionario visual basic
Diccionario visual basic
 
Programa en emu8086
Programa en emu8086Programa en emu8086
Programa en emu8086
 
Instrucciones(raptor, java, c#)
Instrucciones(raptor, java, c#)Instrucciones(raptor, java, c#)
Instrucciones(raptor, java, c#)
 
Comandos
ComandosComandos
Comandos
 
Instrucciones(raptor, java, c#)
Instrucciones(raptor, java, c#)Instrucciones(raptor, java, c#)
Instrucciones(raptor, java, c#)
 
Entrega 8 arreglos - controles - gráficos
Entrega 8   arreglos - controles - gráficosEntrega 8   arreglos - controles - gráficos
Entrega 8 arreglos - controles - gráficos
 

Ejercicios de visual

  • 1.
  • 2.
  • 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
  • 6.
  • 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
  • 10.
  • 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
  • 14.
  • 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