Adding numbers,can somebody help? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Adding numbers,can somebody help?

satsocsatsoc Posts: 19Member
allthough i know many computer languages VB is not my speciallity.so i just want to create a simple program that adds two numbers that we type from keyboard and prints the result.my problem is that i don't know how can i input these nums.

any help would be really appreciated

Comments

  • hobbyhobby Posts: 84Member
    : allthough i know many computer languages VB is not my speciallity.so i just want to create a simple program that adds two numbers that we type from keyboard and prints the result.my problem is that i don't know how can i input these nums.
    :
    : any help would be really appreciated
    :

    Stick three textboxes on a form and a command button. Name the third textbox txt_Result. Set the caption of the command button to "Find Sum"

    Add the following code to your form:
    [code]
    Private Sub Command1_Click()
    if text1.text = vbnullstring OR text2.text = vbnullstring then
    msgbox "Please enter a number in each textbox."
    exit sub
    end if
    txt_Result.text = Val(text1.text) + Val(text2.text)
    End Sub
    [/code]

Sign In or Register to comment.