Quick Start Guide
Build a working calculator app in just 5 minutes. No prior experience neededโfollow along step by step.
Prerequisites
Just a modern web browser (Chrome, Firefox, Safari, or Edge). That's itโno downloads, no installation, no account required.
Open WebVB Studio
Navigate to app.webvbstudio.com in your browser. You'll see the IDE load with a blank form ready for design.
Add Controls to Your Form
We'll create a simple calculator. Add the following controls by dragging them from the Toolbox onto the form:
txtNumber1 โ for the first numbertxtNumber2 โ for the second numbercmdAdd โ set Caption to "Add"lblResult โ to display the resultWrite the Event Handler
Double-click the "Add" button to open the code editor. This automatically creates a click event handler. Add the following code:
Private Sub cmdAdd_Click()
Dim num1 As Double
Dim num2 As Double
Dim result As Double
num1 = Val(txtNumber1.Text)
num2 = Val(txtNumber2.Text)
result = num1 + num2
lblResult.Caption = "Result: " & result
End Sub def cmdAdd_Click():
num1 = float(txtNumber1.Text)
num2 = float(txtNumber2.Text)
result = num1 + num2
lblResult.Caption = f"Result: " + str(result) Understanding the Code
txtNumber1.Textโ Gets the text from the first textboxVal()orfloat()โ Converts text to a numberlblResult.Captionโ Sets the label's display text
Run Your Application
Press F5 or click the Run button in the toolbar.
Extend Your Calculator
Now let's add more operations! Add three more buttons for Subtract, Multiply, and Divide:
Private Sub cmdAdd_Click()
lblResult.Caption = Val(txtNumber1.Text) + Val(txtNumber2.Text)
End Sub
Private Sub cmdSubtract_Click()
lblResult.Caption = Val(txtNumber1.Text) - Val(txtNumber2.Text)
End Sub
Private Sub cmdMultiply_Click()
lblResult.Caption = Val(txtNumber1.Text) * Val(txtNumber2.Text)
End Sub
Private Sub cmdDivide_Click()
If Val(txtNumber2.Text) 0 Then
lblResult.Caption = Val(txtNumber1.Text) / Val(txtNumber2.Text)
Else
lblResult.Caption = "Cannot divide by zero!"
End If
End Sub ๐ Congratulations!
You've built your first WebVB Studio application! Here's what you learned: