Q&A for How to Create a Simple Calculator in Visual Basic 6.0

Return to Full Article

Search
Add New Question
  • Question
    How do I code a calculator in VB?
    Community Answer
    Start by designing the interface of your calculator, then you start your coding by declaring the values you are using, such as a,b,c, for each command you have open in your interface. a=val(Text1.Text) b=val(Text2.Text) c=a+b Text3.Text=c a= the value you enter in text1(text box) b= the value you enter in text2(text box) c= the label to display your answer
  • Question
    How can I become an expert in programming?
    Community Answer
    Practice as much as possible and always challenge yourself to learn more and more complex things.
  • Question
    Any number divide by 0 is = 1? How I can fix that?
    Community Answer
    You might want to code in an error message because officially, dividing by 0 is UNDEFINED.
  • Question
    How do I add an About button?
    Community Answer
    Add a button to your form and write the following into the code of the button: messagebox("Title", "This program is by X and it's best for Y...", MSBoxStyle.Information).
  • Question
    How do I add username and password fields?
    Community Answer
    If you want to create a User login add two textboxes and one button. Set PasswordChar to '*' in one textbox and code the button to compare both textboxes to the right username.
Ask a Question

      Return to Full Article