0% found this document useful (0 votes)
52 views12 pages

Códigos de Programación

The document contains 11 sections describing how to create various controls and programs using coding. It includes examples of creating buttons, text boxes, message boxes and launching other programs. Code snippets are provided for each example.

Uploaded by

ryantierrag
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)
52 views12 pages

Códigos de Programación

The document contains 11 sections describing how to create various controls and programs using coding. It includes examples of creating buttons, text boxes, message boxes and launching other programs. Code snippets are provided for each example.

Uploaded by

ryantierrag
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/ 12

1

Códigos de Programación

Danna Tierra Guerra

Unidad Educativa Particular “Américo Vespucio”


3° Bachillerato: Informática
Ing. Luis R. Núñez
2 de enero del 2024
2

1. Mapa de Caracteres

Public Class Form1

Private Sub Button1_click(sender As Object, e As EventArgs) Handles Button1.Click


Dim Proceso As New Process()
Proceso.StartInfo.FileName = "charmap.exe"
Proceso.StarInfo.Arguments = ""
Proceso.Start()
End Sub
End Class

Figura 1
3

2. Control Listbox

Public Class Form

Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles

ComboBox1_SelectedIndexChange

End Sub

End Class

Figura 2
4

3. Mostrar un mensaje

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

Dim Nombre As String

Nombre = "Danna Tierra"

MsgBox(Nombre)

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

End Sub

End Class
5

Figura 3

4. Figura

Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

End Sub

Private Sub Form1_paint(sender As Object, e As PaintEventArgs) Handles Me.Paint

Dim Oval As Graphics

Oval = Me.CreateGraphics

Dim PenColor As New Pen(Color.Red)

Oval.DrawEllipse(PenColor, 50, 50, 200, 160)

End Sub

End Class

Figura 4
6

5. Formulario creado con Código

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

Dim From2 As New Form

From2.StartPosition = FormStartPosition.CenterScreen

From2.BackColor = Color.Gold

From2.ShowDialog()

End Sub

End Class

Figura 5
7

6. Formulario de Prueba

Public Class Form1

Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click

End Sub

End Class

Figura 6
8

7. Historia

Public Class Form1

Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles

ListBox1.SelectedIndexChanged

Dim I As String

I = ListBox1.SelectedItem

If ListBox1.SelectedItem = "download" Then

PictureBox1.Image = My.Resources.download

End If

End Sub

End Class

Figura 7
9

8. Mi primer Proyecto

Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

Dim MSG As String

MSG = "!hola mundo!"

MsgBox(MSG)

End Sub

End Class

Figura 8
10

9. Mostrar IP

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

Dim Nombre_host As String = Net.Dns.GetHostName

Dim este_host As Net.IPHostEntry = Net.Dns.GetHostByName(Nombre_Host)

Dim Direccion_ip As String = este_host.AddressList(0).ToString

TextBox1.Text = Direccion_ip

End Sub

End Class

Figura 9
11

10. Mostrar Calculadora

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

Dim Proceso As New Process()

Proceso.StartInfo.FileName = "Calc.exe"

Proceso.StartInfo.Arguments = ""

Proceso.Start()

End Sub

End Class

Figura 10
12

11. WindowsApp2

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

TextBox1.Clear()

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

TextBox1.text = " "

End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click

TextBox1.Text = Nothing

End Sub

Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles

TextBox1.TextChanged

End Sub

End Class

You might also like