How to Do Algebra in Visual Basic 6
Programmers use Visual Basic to create applications that perform many functions without having to write much code. Its syntax was designed to save time and Visual Basic's development environment makes programming even faster by letting you "design" the application's appearance. By declaring variables and performing operations on them, you can make your Visual Basic application do algebra, returning results very quickly.
Instructions
-
-
1
Open your Visual Basic environment and start a new project.
-
2
Click on the icon of a textbox and drag a box around your form in the designer to create a textbox. Call the textbox "tbX." Create another textbox in this fashion, calling it "tbY." You don't have to really call them these names, but for the sake of an example, these names will be used.
-
-
3
Create a button on your form and call it "btnCalc."
-
4
Create a label called "lblResult." The label icon shows as a letter A on your toolbox.
-
5
Double-click on your recently created button. This takes you to the button's click event, where you perform the algebraic equation and show the result on your label.
-
6
Write the following code to perform a simple algebraic equation:
lblResult.Text = tbX.Text + 186 / tbY.Text
Be creative and manipulate this equation as you wish.
-
1