-
Notifications
You must be signed in to change notification settings - Fork 0
/
ejemplos.vb.txt
54 lines (41 loc) · 1.51 KB
/
ejemplos.vb.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim mar As Single
Dim sell As Single
Dim cost As Single
Dim ajus As Single
Dim dif As Single
Dim cien As Double
'Numero 100
cien = 100
'Ingreso de Datos
cost = Val(TextCOST.Text)
sell = Val(TextSELL.Text)
'Calculo del Margen de Ganancia
mar = ((sell - cost) / sell) * cien
'Calculo del Margen Porcentual
ajus = ((sell - cost) / cost) * cien
'Calculo diferencia
dif = sell - cost
'Salida de Datos
TextMAR.Text = mar
TextPOR.Text = ajus
TextDIF.Text = dif
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'Limpiar en los ingresos de datos
TextCOST.Text = " 0.0 "
TextSELL.Text = " 0.0"
'Limpiar Pantalla en los resultados
TextMAR.Text = " 0.0 "
TextPOR.Text = " 0.0 "
TextDIF.Text = " 0.0 "
TextCOST.Focus()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Application.Exit()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
AboutBox1.ShowDialog()
End Sub
End Class