Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Ad icon
ZTE MF283U 4G Unlocked Router (Used)
ayanthamaxi
Updated:
Sunday at 8:26 PM
ලංකාවේ හොඳම උපකාරක පන්ති සහ ගුරුවරුන් එකම තැනකින් - TopTuition.lk
dulithapathum
Updated:
Saturday at 8:07 AM
Colombo
RidhMathraa ’26 🎶✨
Tmadhusanka
Updated:
Jul 15, 2026
Ad icon
Colombo
PXN V10 Pro Direct Drive Racing Wheel (Under Warranty)
Abdur Rahman
Updated:
Jul 15, 2026
Ad icon
USDT ණය සේවාව - USDT Loan Service
පුරවැසියා
Updated:
Jul 15, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
Computers & Internet
Tips & Tricks
Visual Basic Codes
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="deegopower" data-source="post: 5579814" data-attributes="member: 6596"><p>Simple calculator......</p><p></p><p>Dim n1, n2, ans As Variant</p><p>Dim cal As String</p><p>Private Sub cmdAdd_Click()</p><p> n1 = Val(txtDisplay.Text)</p><p> cal = "Add"</p><p> txtDisplay.Text = ""</p><p>End Sub</p><p></p><p>Private Sub cmdClear_Click()</p><p> txtDisplay.Text = ""</p><p> n1 = 0</p><p> n2 = 0</p><p> ans = 0</p><p> cal = ""</p><p>End Sub</p><p></p><p>Private Sub cmdDivide_Click()</p><p> n1 = Val(txtDisplay.Text)</p><p> cal = "Div"</p><p> txtDisplay.Text = ""</p><p>End Sub</p><p></p><p>Private Sub cmdEq_Click()</p><p> n2 = txtDisplay.Text</p><p> Select Case cal</p><p> Case "Add"</p><p> ans = n1 + n2</p><p> Case "Subt"</p><p> ans = n1 - n2</p><p> Case "Mul"</p><p> ans = n1 * n2</p><p> Case "Div"</p><p> If n2 = 0 Then</p><p> ans = "Can not divide by Zero"</p><p> Else</p><p> ans = n1 / n2</p><p> End If</p><p> End Select</p><p> txtDisplay.Text = ans</p><p> </p><p> </p><p> </p><p>End Sub</p><p></p><p>Private Sub cmdMul_Click()</p><p> n1 = Val(txtDisplay.Text)</p><p> cal = "Mul"</p><p> txtDisplay.Text = ""</p><p>End Sub</p><p></p><p>Private Sub cmdNo_Click(Index As Integer)</p><p></p><p> txtDisplay.Text = txtDisplay.Text + cmdNo(Index).Caption</p><p> </p><p>End Sub</p><p></p><p>Private Sub CMDOFF_Click()</p><p>End</p><p>End Sub</p><p></p><p>Private Sub cmdSub_Click()</p><p> n1 = Val(txtDisplay.Text)</p><p> cal = "Subt"</p><p> txtDisplay.Text = ""</p><p>End Sub</p></blockquote><p></p>
[QUOTE="deegopower, post: 5579814, member: 6596"] Simple calculator...... Dim n1, n2, ans As Variant Dim cal As String Private Sub cmdAdd_Click() n1 = Val(txtDisplay.Text) cal = "Add" txtDisplay.Text = "" End Sub Private Sub cmdClear_Click() txtDisplay.Text = "" n1 = 0 n2 = 0 ans = 0 cal = "" End Sub Private Sub cmdDivide_Click() n1 = Val(txtDisplay.Text) cal = "Div" txtDisplay.Text = "" End Sub Private Sub cmdEq_Click() n2 = txtDisplay.Text Select Case cal Case "Add" ans = n1 + n2 Case "Subt" ans = n1 - n2 Case "Mul" ans = n1 * n2 Case "Div" If n2 = 0 Then ans = "Can not divide by Zero" Else ans = n1 / n2 End If End Select txtDisplay.Text = ans End Sub Private Sub cmdMul_Click() n1 = Val(txtDisplay.Text) cal = "Mul" txtDisplay.Text = "" End Sub Private Sub cmdNo_Click(Index As Integer) txtDisplay.Text = txtDisplay.Text + cmdNo(Index).Caption End Sub Private Sub CMDOFF_Click() End End Sub Private Sub cmdSub_Click() n1 = Val(txtDisplay.Text) cal = "Subt" txtDisplay.Text = "" End Sub [/QUOTE]
Insert quotes…
Verification
Haya warak paha keeyada? (haya wadi kireema paha)
Post reply
Top
Bottom