Ejercicios de programación .net (nivel inicial)

Se muestra el funcionamiento de los conceptos básicos para programar en .net Se muestra el funcionamiento de los conceptos básicos para programar en .net

10.04.2019 Views

Public Class Form6 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim num As Double num = Val(TextBox1.Text) If num = 0 Then TextBox2.Text = "Ingrese un Número Diferente de Cero" TextBox1.Text = "" TextBox2.Text = "" TextBox1.Focus() End If End Sub If num < 0 Then TextBox2.Text = "EL NÚMERO ES NEGATIVO" Else TextBox2.Text = "EL NÚMERO ES POSITIVO" End If Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click End End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Form7.Show() Me.Hide() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" TextBox1.Focus() End Sub End Class Leonel Navarrete

Serie Fibonacci Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click End Sub End Class Dim N, f1, f2, s As Integer N = Val(TextBox1.Text) f1 = 0 f2 = 1 For I = 1 To N Step 1 f1 = f2 f2 = s TextBox2.Text = TextBox2.Text & " " & s ListBox1.Items.Add(TextBox2.Text) s = f1 + f2 Next Leonel Navarrete

Public Class Form6<br />

Private Sub Button1_Click(ByVal sen<strong>de</strong>r As System.Object, ByVal e As<br />

System.EventArgs) Handles Button1.Click<br />

Dim num As Double<br />

num = Val(TextBox1.Text)<br />

If num = 0 Then<br />

TextBox2.Text = "Ingrese un Número Diferente <strong>de</strong> Cero"<br />

TextBox1.Text = ""<br />

TextBox2.Text = ""<br />

TextBox1.Focus()<br />

End If<br />

End Sub<br />

If num < 0 Then<br />

TextBox2.Text = "EL NÚMERO ES NEGATIVO"<br />

Else<br />

TextBox2.Text = "EL NÚMERO ES POSITIVO"<br />

End If<br />

Private Sub Button4_Click(ByVal sen<strong>de</strong>r As System.Object, ByVal e As<br />

System.EventArgs) Handles Button4.Click<br />

End<br />

End Sub<br />

Private Sub Button3_Click(ByVal sen<strong>de</strong>r As System.Object, ByVal e As<br />

System.EventArgs) Handles Button3.Click<br />

Form7.Show()<br />

Me.Hi<strong>de</strong>()<br />

End Sub<br />

Private Sub Button2_Click(ByVal sen<strong>de</strong>r As System.Object, ByVal e As<br />

System.EventArgs) Handles Button2.Click<br />

TextBox1.Text = ""<br />

TextBox2.Text = ""<br />

TextBox1.Focus()<br />

End Sub<br />

End Class<br />

Leonel Navarrete

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!