0% found this document useful (0 votes)
57 views

Universidad Politécnica Salesiana Nombre: Bryan Rodríguez Grupo: 3A Fecha: 28/01/2016

This document contains code for a login form and multiple option windows in Visual Basic. The login form allows a user to enter a username and password, and either proceeds to a main options window or displays an error. The main options window contains menu options to launch additional windows for tasks like binary conversion, finding the largest number, determining the month from a number, calculating factorials and Fibonacci sequences. Each task window contains code to perform its specific operation and include buttons to reset fields or return to the main options window.

Uploaded by

Bryan Rodriguez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

Universidad Politécnica Salesiana Nombre: Bryan Rodríguez Grupo: 3A Fecha: 28/01/2016

This document contains code for a login form and multiple option windows in Visual Basic. The login form allows a user to enter a username and password, and either proceeds to a main options window or displays an error. The main options window contains menu options to launch additional windows for tasks like binary conversion, finding the largest number, determining the month from a number, calculating factorials and Fibonacci sequences. Each task window contains code to perform its specific operation and include buttons to reset fields or return to the main options window.

Uploaded by

Bryan Rodriguez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Universidad Politcnica Salesiana

Nombre: Bryan Rodrguez

Grupo: 3A

Fecha: 28/01/2016

VENTANA DE OPCIONES

Dim I As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
I = I + 1
If ((TextBox1.Text = "Bryan") And (TextBox2.Text = "1234")) Then
Form2.Show()
Else
MsgBox("EL USUARIO O LA CLAVE SON INCORRECTAS, INTENTE DE NUEVO")
If I = 3 Then
MsgBox("SUPERO EL NUMERO DE INTENTOS")
End
End If
End If
End Sub

Private Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles


Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
End Sub

Private Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles


Button3.Click
End

End Sub
End Class
Public Class Form2

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


As System.EventArgs) Handles BinarioToolStripMenuItem.Click
Me.Hide()
binario.Show()
End Sub

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


As System.EventArgs) Handles OctalToolStripMenuItem.Click
Me.Hide()
octal.Show()

End Sub

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


As System.EventArgs) Handles MayorToolStripMenuItem.Click
Me.Hide()
mayor.Show()
End Sub

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


As System.EventArgs) Handles MesYAoToolStripMenuItem.Click
Me.Hide()
meses_del_ao.Show()
End Sub

Private Sub FactorialToolStripMenuItem_Click(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles FactorialToolStripMenuItem.Click
Me.Hide()
factorial.Show()
End Sub

Private Sub FibonacciToolStripMenuItem_Click(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles FibonacciToolStripMenuItem.Click
Me.Hide()
fibonacci.Show()
End Sub

Private Sub CambioDeBaseToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles CambioDeBaseToolStripMenuItem.Click

End Sub
End Class
Public Class binario

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


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

Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles


Button1.Click
Dim N, N1, C, R As Integer
N = TextBox1.Text
N1 = N
While (N >= 2)
C = N \ 2
R = N Mod 2
TextBox2.Text = TextBox2.Text & Str(R)
N = C

End While
TextBox2.Text = TextBox2.Text & Str(C)
End Sub

Private Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles


Button3.Click
Me.Hide()
Form2.Show()
End Sub
End Class
Public Class octal

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


System.EventArgs) Handles Button1.Click
Dim N, N1, C, R As Integer
N = TextBox1.Text
N1 = N
While (N >= 8)
C = N \ 8
R = N Mod 8
TextBox2.Text = TextBox2.Text & Str(R)
N = C

End While
TextBox2.Text = TextBox2.Text & Str(C)
End Sub

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


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

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


System.EventArgs) Handles Button3.Click
Me.Hide()
Form2.Show()
End Sub
End Class

z = TextBox3.Text
If (x > y) And (x > z) And (y > z) Then
TextBox4.Text = x
End If
If (x > y) And (x > z) And (z > y) Then
TextBox4.Text = x
End If
If (y > x) And (y > z) And (x > z) Then
TextBox4.Text = y
End If
If (y > x) And (y > z) And (z > x) Then
TextBox4.Text = y
End If
If (z > x) And (z > y) And (x > y) Then
TextBox4.Text = z
End If
If (z > x) And (z > y) And (y > x) Then
TextBox4.Text = z
End If

End Sub

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


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

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


System.EventArgs) Handles Button3.Click
Me.Hide()
Form2.Show()
End
End Sub
End Class

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


System.EventArgs) Handles Button1.Click
num = Val(TextBox1.Text)
Select Case num
Case "1"
TextBox2.Text = ("enero ")
Case "2"
TextBox2.Text = ("febrero ")
Case "3"
TextBox2.Text = ("marzo ")
Case "4"
TextBox2.Text = ("abril ")
Case "5"
TextBox2.Text = ("mayo")
Case "6"
TextBox2.Text = ("junio")
Case "7"
TextBox2.Text = ("julio")
Case "8"
TextBox2.Text = ("agosto")
Case "9"
TextBox2.Text = ("septiembre")
Case "10"
TextBox2.Text = ("octubre")
Case "11"
TextBox2.Text = ("noviembre")
Case "12"
TextBox2.Text = ("diciembre")
Case Else
TextBox2.Text = ("")
MsgBox("fuera de rango")
End Select

End Sub

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


System.EventArgs) Handles Button3.Click
Me.Hide()
Form2.Show()
End
End Sub

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


System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
End Sub
End Class

Public Class factorial


Dim x, j, f As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
x = TextBox1.Text
f = 1
For j = x To 1 Step -1
f = f * j
Next
TextBox2.Text = f
End Sub

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


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

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


System.EventArgs) Handles Button3.Click
Me.Hide()
Form2.Show()
End
End Sub
End Class

Public Class fibonacci


Dim n, w, x, y, z As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
n = TextBox1.Text()
w = 0
x = 1
y = 0
z = 2
If n = 1 Then
y = 1
End If
While z <= n
y = w + x
w = x
x = y
z = z + 1
End While
TextBox2.Text = y
End Sub

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


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

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


System.EventArgs) Handles Button3.Click
Me.Hide()
Form2.Show()
End
End Sub
End Class

You might also like