| | |
VB.NET Calculator
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
Adding to Numbers using your Numeric keypad VB.NET 2003
Just drag 1 label to your form
label1.backcolor = color.black
label1.forecolor = color.green
make some adjustments to your font as you want
Declare your variables
in your form use the KeyUp event
and place the code below
so if i hopes there's nothing missing on the codes
Just drag 1 label to your form
label1.backcolor = color.black
label1.forecolor = color.green
make some adjustments to your font as you want
Declare your variables
in your form use the KeyUp event
and place the code below
VB.NET Syntax (Toggle Plain Text)
Private f as String 'your first number Private s as String 'your second number private n as String private o as String 'this will be your operators variable Private sum as Double Private Sub MainForm_KeyUp(Byval sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp Select case e.KeyCode Case keys.Numpad0, keys.NumPad1 '(provide all the keycodes) f = e.KeyCode.ToString 'this will display what key your pressed f = f.Substring(6, 1) 'we will extract the last string of the keycode string n = n & f 'we will pass our first number to our variable n me.label1.Text = n 'we will display whats on variable n Case keys.Decimal 'hmmm we will make some flavoring here n = n & "." f = "" n = n & f Case keys.Add o = "+" 'assign a plus sign to operators variable s = n 'we will pass our first number to the second number sum= Val(s) + Val(r) ' me.label1.Text = FormatNumber(sum, 2, TriState.True, TriState.True, TriState.True) n = "" r = sum Case keys.Subtract 'do your part, explore, and discover something extraordinary 'happy coding End Select
so if i hopes there's nothing missing on the codes
![]() |
Similar Threads
- Object Orientated C+++.net Calculator! (C++)
- ASP .net programmer (Web Development Job Offers)
- VB.Net (VB.NET)
- How do you build the dot in calculator. (C++)
- ASP.NET / C# Dynamic Control (ASP.NET)
- How to re-install software, I have lost my Calculator!! (OS X)
- Visual Basic.net (VB.NET)
Other Threads in the VB.NET Forum
- Previous Thread: vb.net setup file
- Next Thread: How to print multiple pages from database record
| Thread Tools | Search this Thread |
.net .net2008 30minutes 2005 2008 access account arithmetic array basic bing button buttons center check code combobox component connectionstring crystalreport data database databasesearch datagrid datagridview date design dissertation dissertations dropdownlist excel fade file-dialog filter folder ftp generatetags google gridview hardcopy images input insert intel internet mobile monitor ms net networking objects output panel passingparameters peertopeervideostreaming picturebox picturebox1 port position print printing problem problemwithinstallation project save searchbox searchvb.net select serial shutdown soap survey table tcp temperature text textbox timer timespan toolbox trim update updown user vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf year





