• We just launched and are currently in beta. Join us as we build and grow the community.

Vb.Net Calculator Ver. 1.0

dsfjkdsfh4335

Stablecoin Arbitrageur
D Rep
0
0
0
Rep
0
D Vouches
0
0
0
Vouches
0
Posts
146
Likes
176
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 300 XP
Hello, this source code demonstrates how to create a basic calculator using Visual Basic.Net
This Calculator application can perform two tasks i.e Addition and Subtraction of whole numbers.

Global Variables
  1. Dim

    operater_on As

    Boolean

    =

    False
  2. Dim

    operater As

    String

    =

    ""
  3. Dim

    val1, val2 As

    Double

Form Load Event
  1. Private

    Sub

    Form1_Load(

    sender As

    Object

    , e As

    EventArgs)

    Handles

    MyBase

    .

    Load
  2. AddHandler

    btn0.

    Click

    , AddressOf

    buttonClick
  3. AddHandler

    btn1.

    Click

    , AddressOf

    buttonClick
  4. AddHandler

    btn2.

    Click

    , AddressOf

    buttonClick
  5. AddHandler

    btn3.

    Click

    , AddressOf

    buttonClick
  6. AddHandler

    btn4.

    Click

    , AddressOf

    buttonClick
  7. AddHandler

    btn5.

    Click

    , AddressOf

    buttonClick
  8. AddHandler

    btn6.

    Click

    , AddressOf

    buttonClick
  9. AddHandler

    btn7.

    Click

    , AddressOf

    buttonClick
  10. AddHandler

    btn8.

    Click

    , AddressOf

    buttonClick
  11. AddHandler

    btn9.

    Click

    , AddressOf

    buttonClick
  12. End

    Sub

Number buttons click handler
  1. Private

    Sub

    buttonClick(

    sender As

    Object

    , e As

    EventArgs)

  2. Dim

    btn As

    Button =

    DirectCast

    (

    sender, System.

    Windows

    .

    Forms

    .

    Button

    )
  3. If

    lblDisplay.

    Text

    =

    "0"

    Or

    operater_on =

    True

    Then
  4. lblDisplay.

    Text

    =

    btn.

    Text
  5. operater_on =

    False
  6. Else
  7. lblDisplay.

    Text

    =

    lblDisplay.

    Text

    &

    btn.

    Text
  8. End

    If
  9. End

    Sub

I also welcome other developers to submit their codes such that we build a good network of learning for free.

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.

2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

 

452,292

323,341

323,350

Top