0% found this document useful (0 votes)
20 views2 pages

Inputbox.: Object Eventargs

The document contains code snippets in VB.NET that: 1) Loops from a starting to ending number and sums only odd numbers, outputting the sum. 2) Displays an input box to get a number from the user and displays it. 3) Generates random numbers between two values, concatenates them into a string separated by commas, and displays the string.
Copyright
© Attribution Non-Commercial (BY-NC)
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)
20 views2 pages

Inputbox.: Object Eventargs

The document contains code snippets in VB.NET that: 1) Loops from a starting to ending number and sums only odd numbers, outputting the sum. 2) Displays an input box to get a number from the user and displays it. 3) Generates random numbers between two values, concatenates them into a string separated by commas, and displays the string.
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 2

Ejecicio 1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim vi, vf, i, s, c As Integer vi = txtnvi.

Text vf = Txtnvf.Text For i = vi To vf If i Mod 2 = 0 Then Else s = s + i c = c + 1 End If Next lblR.Text = "La Suma de impares esb:_"

INPUTBOX.
Public Class Form1 Private Sub Lbl1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Lblsalida.Click Dim n As Integer n = Val(InputBox("ingrese nmero", "numeros")) Lblsalida.Text = "El nmero ingresado es : " & n End Sub End Class

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dim i, vi, vf, aleatorio As Integer Dim salida As String Randomize() vi = 5 vf = 130 For i = 1 To 30 aleatorio = CInt(Int(vf - vi +1) * Rnd() + vi)) If salida = "" Then salida = salida & ", " & aleatorio End If Next lblsalida.Text = salida

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dim i, vi, vf, aleatorio As Integer Dim salida As String Randomize() vi = 5

vf = 130 For i = 1 To 30 aleatorio = CInt(Int(vf - vi +1) * Rnd() + vi)) If salida = "" Then salida = aleatorio Else salida = salida & ", " & aleatorio End If Next lblsalida.Text = salida

You might also like