Formularios en VB Y C#

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Taller Controles 27 de Marzo-VB

Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click

End Sub

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click

End Sub

Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click

Dim index As Integer = 0

While index < 100000

index += 1

' If index is between 5 and 7, continue


' with the next iteration.

If index >= 5 And index <= 8 Then

Continue While

End If

' Display the index.

Debug.Write(index.ToString & " ")

' If index is 10, exit the loop.

If index = 10 Then

Exit While

End If

End While

End Sub

Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click

Do [ { While | Until } condition ]

[ statements ]

[ Continue Do ]

[ statements ]

[ Exit Do ]

[ statements ]

Loop

' -or-

Do

[ statements ]

[ Continue Do ]

[ statements ]

[ Exit Do ]
[ statements ]

Loop [ { While | Until } condition ]

End Sub

Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click

End Sub

End Class

Taller C# 10 de Abril-C#

Codigo;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Taller2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button2_Click(object sender, EventArgs e)


{
double a, b, c;
a = double.Parse(textBox1.Text);
b = double.Parse(textBox2.Text);

if (b == 0)
{
textBox3.Text = ("No se puede dividir entre 0");
}
else
{
c = a / b;
textBox3.Text = c.ToString();
}
}

private void button3_Click(object sender, EventArgs e)


{
textBox4.BackColor = Color.Yellow;
}

private void textBox4_TextChanged(object sender, EventArgs e)


{
int n;
n = comboBox1.SelectedIndex;
switch (n)
{
case 0:
comboBox1.BackColor = Color.Yellow;
return;
case 1:
comboBox1.BackColor = Color.Blue;
return;
case 2:
comboBox1.BackColor = Color.Red;
return;

}
MessageBox.Show(n.ToString());
}

private void button1_Click(object sender, EventArgs e)


{
int a, b, c;
a = int.Parse(textBox1.Text);
b = int.Parse(textBox2.Text);
c = a + b;
textBox3.Text = c.ToString();
}

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)


{
int n;
n = comboBox1.SelectedIndex;
switch (n)
{
case 0:
comboBox1.BackColor = Color.Yellow;
return;
case 1:
comboBox1.BackColor = Color.Blue;
return;
case 2:
comboBox1.BackColor = Color.Red;
return;

}
MessageBox.Show(n.ToString());

}
}
}

You might also like