The establishment of advanced calculator
First: the required stuff.
Required stuff is 18 and single button and a text box
Second: the method developed.
You choose possible that you like and I did in the beginning, I advise you to put it as shown in the picture
Third, the design of buttons and text boxes.
First Click one click on the button or the text that you want to modify it and then go to the option box (properties) and go to the option text and change the name as you like, and I advise you to be as shown in the top image and font option can be adjusted on-line and shape as you like, and I I advise you to be Arial, 9.75pt, style = Bold and this line that I'm I prefer.
It can be adjusted on the window (form) as you like and if you want to put the icon I Annsahk Bhama Site Click here
But its outlook me square in the texts you can make the Arial font, 11.25pt, style = Bold.
Fourth: Coded.
On this formic
Option Explicit On
Public Class Form1
Dim x As Single
Dim y As Single
Dim AnswerNumber As Single
Dim ArithmeticProcess As String
This code we will use it for all the numbers 1, 2, 3, 4, etc.
Textbox1.Text = TextBox1.Text & "Here you write the number"
This code will use it for all calculations Change reference only
Here, the division operates all shapes
x = Val (TextBox1.Text)
TextBox1.Text = ""
ArithmeticProcess = "here"
The source code for this process the = and also all possibilities
y = Val (Textbox1.Text)
If ArithmeticProcess = "+" Then
AnswerNumber = x + y
End If
If ArithmeticProcess = "-" Then
AnswerNumber = x- y
End If
If ArithmeticProcess = "*" Then
AnswerNumber = x * y
End If
If ArithmeticProcess = "/" Then
If y = "0" Then
MsgBox ("can not divide by zero", 0, "Warning")
Exit Sub
End If
AnswerNumber = x / y
End If
Textbox1.Text = AnswerNumber
Start of a new code
TextBox1.Clear ()
Fifth: the program experience
And you can try it by pressing the start button, as shown in the picture
So you have advanced calculator and thank you for your reading and Hassan
Author: Mahmoud Ahmed
To communicate
facebook:
https://www.facebook.com/mahmoud.ahmad.980967
youtube:
https://www.youtube.com/channel/UCibGYnyJzB-Yy849HJuKjsA
لا يوجد تعليقات
أضف تعليق