Controles Y Sus Propiedades A Modificar
Propiedades | |
1 label1 | Text = Numero 1 |
2 label2 | Text = Numero 2 |
3 TextBox1 | Name = TxtN1 |
4 TextBox2 | Name = TxtN2 |
5 Label3 | Text= |
6 TextBox3 | Name = TxtResultado |
7 Button1 | Name= BtnSuma Text = + |
8 Button2 | Name = BtnResta Text = - |
9 Button3 | Name = BtnMulti Text = * |
10 Button4 | Name = BtnDivi Text = / |
Operador | Descripción |
+ | Suma |
- | Resta |
* | Multiplicación |
/ | División Real |
\ | División Entera |
^ | Potenciación |
Mod | Resto De La División |
Private Sub BtnSuma_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles BtnSuma.Click Label3.Text = BtnSuma.Text TxtResultado.Text = CInt(TxtN1.Text) + CInt(TxtN2.Text) End Sub Private Sub BtnResta_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles BtnResta.Click Label3.Text = BtnResta.Text TxtResultado.Text = CInt(TxtN1.Text) - CInt(TxtN2.Text) End Sub Private Sub BtnMulti_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles BtnMulti.Click Label3.Text = BtnMulti.Text TxtResultado.Text = CInt(TxtN1.Text) * CInt(TxtN2.Text) End Sub Private Sub BtnDivi_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles BtnDivi.Click Label3.Text = BtnDivi.Text TxtResultado.Text = CInt(TxtN1.Text) / CInt(TxtN2.Text) End Sub
Resultado:
No hay comentarios:
Publicar un comentario