-
Paradosx3.
User deleted
Salve ragazzi... mettetevi comodi, che oggi vi insegnerò come creare una calcolatrice con le funzioni base "+" "-" "x" ":"
Il tutto in pochissime stringhe di codice
Provate a farne una ancora più piccola ahahah.....
Bene! Iniziamo..
Innanzitutto aprite Visual Basic 2008 Express Edition, inserite 5 Button, 1 Label e 3 TextBox..
-1 Bottone = +
-2 Bottone= -
-3 Bottone = x
-4 Bottone = /
Il Quinto Bottone ci da il risultato, quindi avrà valore di " = "
Nel form in basso insetire i 4 bottoni, in alto la prima textbox, leggermente sotto il label e leggermente sotto al label l'altra textbox, vi dovrete trovare in questo modo:SPOILER (click to view)
Nel Bottone " + " scrivete:CODICELabel1.Text = "+"
Nel bottone " - " scrivete:CODICELabel1.Text = "-"
Nel bottone " x " scrivete:CODICELabel1.Text = "*"
Nel bottone " / " scrivete:CODICELabel1.Text = "/"
Nel bottone " = " scrivete:CODICEOn Error Resume Next
Dim Var1 As Integer
Dim var2 As Integer
Var1 = TextBox1.Text
var2 = TextBox2.Text
If Label1.Text = "+" Then
TextBox3.Text = (Var1 + var2)
ElseIf Label1.Text = "-" Then
TextBox3.Text = (Var1 - var2)
ElseIf Label1.Text = "x" Then
TextBox3.Text = (Var1 * var2)
ElseIf Label1.Text = ":" Then
TextBox3.Text = (Var1 / var2)
MsgBox("Calcolatrice by Parad0sx3")
End If
E AVRETE COSI CREATO UNA MINI CALCOLATRICE, con 4 funzioni, naturalmente per farla ancora più piccola eliminate le 2 textbox... altrimenti lasciatela cosi che è davvero carina
Alla prossima...
Guida By Parad0sx3
Copyright. -
.
Prince Of Game Mystic Magican Legend Member lv17
- Group
- Member
- Posts
- 7,969
- Location
- Roma Capitale, Milano Succursale
- Status
- Anonymous
Ottima Guida!! . -
Paradosx3.
User deleted
Grazie, ho il sedere addormentato adesso eh .