Visual Basic .NET Tutorial 4 – How to Create a Simple Calculator in Visual Basic

Searches related to Simple Calculator visual basic
simple calculator visual basic 2010
visual basic code simple calculator
simple calculator using visual basic dll
simple calculator using vb
visual basic program for simple calculator
visual basic calculator source code
How to make a calculator in Visual Basic
Visual Basic : Build a SIMPLE calculator
How To Make A Calculator In Visual Basic 2008
How to Make a simple calculator in Visual Basic
Vb Calculator – VB6
Simple Calculator In Vb – VB6
Visual Basic 6.0 Simple Age Calculator – VB6
Simple Calculator visual basic
Basic Calculator In VB.Net – VB.NET Tutorials
vb calculator code sample
calculator in vb 2010

Comments

Endrit Shabani says:

why i get this error 
Error 1 Value of type ‘Single’ cannot be converted to ‘System.Windows.Forms.Label’. c:usersuserdocumentsvisual studio 2010ProjectsWindowsApplication3WindowsApplication3Form1.vb 10 23 WindowsApplication3

PtahX says:

Thank you for the great video!   I’m really new to this but my message box doesn’t pop up for some reason

jerome palentinos says:

WHY USE COMMA INSTEAD OF DOUBLE VAR

mona kapoor says:

sir / mam your video is very awesome and easily understanding but I want a video on Pythagoras theorem .. sir / mam can u plzz send link ( on visual basic)

Sam90o Gaming says:

wtf y the hell did I use ” , ” in place of decimal y it can’t show the correct answer by writing 2.33 and 4.22

Christian Santos says:

Nice Video 🙂

Muhammad Akbar says:

Great

Ghunghroo Khare says:

plzz explain me the concept of comma in i/p & result
hw floating pint variable accepts “,” and not “.” in result msg box

kwstas ber says:

Perfect

Anastasiu David Nicolae says:

Give Code!!!!!

Andrew Crawford says:

Thanks so much! This helped clarify a lot of things I was having issues with.

Ray-an Fuentes says:

operator ‘+’ is not defined for types ‘system.windows.forms.textbox’ and system.windows.forms.textbox’

I can’t run. There’s an error 🙁

Md. Afsar Ahmed Jakir says:

If you want float number Like(2.555) then you don’t put direct text value in variable So you have to coding like this

Dim Number1 As Single
Dim Number2 As Single
Dim Answer As Single

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Number1 = Val(TextBox1.Text)
Number2 = Val(TextBox.Text)
Answer = Number1 + Number2

MessageBox.Show(Answer)
End Sub

Just Type Val(TextBox1.Text), It is convert string value to Numaric Value

George Galloway says:

Indians:

Teaching the world to code since 1991

Anastasiu David Nicolae says:

Best Visual Basic Calculator Tutorial Ever 🙂 🙂

Extreme MLG Bass Boosts says:

May i ask, Is there a way to an array of text, and seperate them by , I need to get 2.5,5,66, into 2.5 5 66

sakarNasrullah Pc says:

thanku

Tacoobell says:

if you wanted to change the complete style of msgbox you can make a form with a text box and use this:
Form2(whatever your form name).TextBox1.Text = Answer

shesha says:

Shared on Google+

Nurul Fatihah says:

what if incomplete values?? how to do that??

Switch On says:

Nice tut.

Jonathan Morley says:

Thanks for these vids. I took programming in college but have mostly used java since i’ve graduated. I’ve needed to brush up on my vb.net skills since I haven’t touched the language since 2009.

BTW: In this video he mentions changing the Integer to a Single, but you can also change it to a Decimal to actually get it to include the decimal point in the result.

Andraž Glavan says:

K s ti bolan?! Kurwa

Muhammed Mafas says:

thx a lot for video. my problem is that can i get the “result” in to label without a msgbox.??? please answer me

Y. Aakash says:

thanks for the video 🙂
when i subtract a higher value from lower value, answer endup in error. can we showup negative numbers? and how?

Natalie Anderson says:

Help not sure what I did wrong the coding matches exactly as the video

Number1 = TextBox1.Text error message pops up there saying Text System.InvalidCastException: ‘Conversion from string “” to type ‘Integer’ is not valid.

‘System.InvalidCastException occurred
HResult=0x80004002
Message=Conversion from string “” to type ‘Integer’ is not valid.
Source=
StackTrace:
at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)
at first_calculator.Form1.TextBox1_TextChanged(Object sender, EventArgs e) in c:usersbabydocumentsvisual studio 2017Projectsfirst calculatorfirst calculatorForm1.vb:line 10
at System.Windows.Forms.Control.OnTextChanged(EventArgs e)
at System.Windows.Forms.TextBoxBase.OnTextChanged(EventArgs e)
at System.Windows.Forms.TextBoxBase.WmReflectCommand(Message& m)
at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
at System.Windows.Forms.TextBox.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.Control.DefWndProc(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
at System.Windows.Forms.TextBox.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at first_calculator.My.MyApplication.Main(String[] Args) in :line 81

Inner Exception 1:
FormatException: Input string was not in a correct format.

ProgrammingKnowledge says:
rushi bhatt says:

thank you sir

 Write a comment

*

Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!