You are on page 1of 4

Cerrar o retornar botón Me.

Hide()

Ir de un botón a un formulario Form3.Show()

Mensaje MsgBox(“hola mundo”


MsgBox("seleccione la opcion", MsgBoxStyle.Information, "menu opciones")
Crear variable: Dim entero As Integer = 1

Mostrar variable en mensaje: MsgBox(entero)

Cambiar valor: entero = 2

MsgBox (entero)

Variable con decimales: Dim numero As Double = 12.456

Variable con texto Dim texto As String = “hola mundo”

MsgBox(texto)

MsgBox(texto + texto2) muestra los dos textos juntos

Variable fecha: Dim fecha As Date = “01-01-12”

MsgBox (fecha)

Arreglos variables

Dim arreglo(3) As string

Arreglo(0) = “hola”

Dim arreglo () As integer

Arreglo = New Integeer() {1, 2, 3}

MsgBox (arreglo(0).Tostring + “ “ + arreglo(1).Tostring+ arreglo(2).Tostring)

Para mostrar 2 valores y quitar 1 : Redim Preserve arreglo(2)

SUMA:

Dim num1, num2, operación As Integer

Num1= 2

Num 2=5

Operación = num1 + num2

MsgBox(operacion.ToString)
Text box

Se puede nombrar en las propiedades

Se nombr texto

Texto.Text = “hola”

Texto.TextAlign = Horizontal

SUMA CON BOTON Y CUADRO DE TEXTO


Dim num1, num2, suma As Integer

num1 = boxnum1.Text

num2 = boxnum2.Text

suma = num1 + num2

MsgBox(suma)

< > diferente


Boolean true false

Public Class Form8

Dim g As Double = 9.8


Dim t As Double = 0.0
Dim a As Double = 0.0

Private Sub VolverToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles VolverToolStripMenuItem.Click
Me.Hide()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
t = TextBox1.Text
a = (0.5 / g) * (t * t)
TextBox2.Text = a
End Sub

Private Sub Form8_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load

End Sub
End Class
Public Class Form5
Dim altura, peso, resultado As Double

Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Label1.Click

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
peso = TextBox1.Text
altura = TextBox2.Text
resultado = peso / (altura * altura)
TextBox3.Text = resultado
Label3.Text = "Su indice de Masa Corporal es: "
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Limpiar.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
End Sub

Private Sub Button2_Click_1(sender As System.Object, e As System.EventArgs)


Handles Button2.Click
End
End Sub

Private Sub Button3_Click(sender As System.Object, e As System.EventArgs)


Handles Button3.Click
Form1.Show()
Me.Hide()
End Sub

Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load

End Sub
End Class