 |
 |
 |
 |
| Right all seems to fine with this, aslong as you understand how to set up the gui so you are creating an array of command buttons and putting 0-9 on them, and some others for *,/,-,+ then all is ok, just to mention even though with this calculator it is not possible first = txtDisplay.Text i would have changed to first = Val(txtDisplay.Text), just out of practice, anyway. If you still need help I'll provide some.
Sarkie |
|
 |
| | Ah, blatant plagiarism... where would we be without it? |
|
 |
| |
 |
| | Well, my codes for the cal go different and i am stuck up with, its not taking the second digit into display. Help me out....... |
|
 |
| | Try F5ing the code..a nd post the lines that seem to be giving errors. |
|
 |
| |
 |
| | if you not getting anything to display check the index, it should be blank for Clear,Equal and dot. Also 0-9 should all be Command1 but they should have a ranging index that also goes from 0-9. The same goes for (+)(-)(/)(*) They should all be named Command2 and have a ranging index of 0-3. Things will mess up if somthing insn't an array and the index is somthing other then blank. I Hope this clear things up for anyone that has or will look at this post. because the Author failed to throughly explain such things. |
|
 |
| Whats funny about that fellow is it seems everyone younger than 18-19 is using that type of language, examiners have even had to go on several courses to understand the "New-age language" as it is now submissible in exams.
Personally i hate such abbreviations and put it down to sheer lazyness, ok on a mobile-phone where you have limited space i guess its ok, but on paper/e-mails whats the point? i proved this to my sister not long back i typed normal english she typed her txt-slang and i still managed to finish before her, it doesn't look cool and its not easier.
Granted, i make spelling mistakes lol
Ref:
http://www.bbc.co.uk/voices/yourvoice/language_rules1.shtml
http://www.bbc.co.uk/wales/northeast/sites/your_shout/pages/txt.shtml
http://scotlandonsunday.scotsman.com/index.cfm?id=350682003 |
|
 |
| Well I'm fifteen and though English is not my mother tongue, I greatly digress with such way of using the English language. Not everyone speaks that way; perhaps only those who are stupid enough to think that they're cool if they could speak that way.
Anyway, I've had the bad luck of having to create a VB Calculator. Thanks for the article.
(The previous comments actually made me laugh.) |
|
 |
| | Thanks very much for this tutorial but theres just one problem. Im using Visual Basic 2003 and the thing is, after I create and copy all the buttons, No message box appears asking me to create an array? Whats the solution to this? Or is that feature not supported in VB 2003. What other way is there. Thanks |
|
 |
| This tutorial really helped me a lot.....i've done a simple calculator by my means, and toke some ideas from this...
but i've used 4 "dims" :p in my calculator..... another one for the result ;) more simple for me.... |
|
 |
| | Anyone? How to make an array manually? Again, I copied the buttons but still no response. And what names did you asign to them? |
|
 |
| sub btnOne_Click(ByVal whatever, and ever, not important)
txtBox.text = appendtext(cstr("1")
'um that skips alot of stuff you just did...
'just convert text later
'oh and i think this only works for 05 |
|
 |
| can any1 help me with inserting a percentage button on visual basic working in the followin way??
enter a number
press the * button
enter the 'percent' of number
press the % button |
|
 |
| I'm not pretty sure how to do this, but why not add:
If keycode = vbKeyA then
End If
It should be used to make it possible to press the +,-,* or / to put it out in the textfield.
I think the ASCII numbers for the keys must be used. Cause it didn't work with + for me to end a program.... |
|
 |
| To the person whoz equal is not working... Did you include Val at the front of your integer values?? eg. Sum= Val(Numkey1)+Val(Numkey2)
This calls the integer values of the text field to be added and not the string. |
|
 |
| Great work. It took a fair bit of studying for a beginer in VB such as myself, but I finally realised what I was doing wrong and it's now exactly what I hoped for! :D thank you for giving me the base to my calculator.
Now I have much work to do in adding to it :) Thanks again! |
|
 |
| | this is not a very good example of a calculator, for one you can only operate on two numbers, secondly there is no error catching for when someone was to press an operator button twice... and there should be better description on what command button 1 and command button 2 actually refer too. designing the program is just as important as coding the program! please keep this in mind, especially when dealing with VB |
|
 |
| | i dont see the point of the txtDisplay.MaxLength = 10 , try entering in 999999999 and then add with any number, see what happens..... |
|
 |
| | Perhaps you should tell which version of VB you are using, it would make it easier to know if it definetely will work for the one you have, or if perhaps I have an other version, because it doesnt seem to work when I type your coding in. Only get error every fking where. |
|
 |
| Private Sub btnSquareRoot_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSquareRoot.Click
If txtDisplay.Text.Length <> 0 Then
tmpValue = CDbl(txtDisplay.Text)
tmpValue = System.Math.Sqrt(tmpValue)
txtDisplay.Text = CStr(tmpValue)
End If
End Sub
thats for SquareRoot... but i need Percentage =.= |
|
 |
| |
 |
| ur code is not proper.
aftre clicking on the add button,it will show addition of second no only,and the first one is ignored.
i.e. if we click on 1+2,it will show 4 i.e. 2+2
kindly give the reply within 10 minutes. |
|
 |
| | I would like to ask whether anyone knows visual basic6.0. If you do could you email me a calculator code with on vb6.0 . Only on the simply operands like +'-'* and /. PLEASE send me one .I have failed to make mine run 3times in a row now. |
|
 |
| i am a begginer in vb and it is difficult to me to understand the codes.. vb is a gui but when i started to generate the codes, it is very tricky and i dont know where to put the codes... it has a churveness of private and piblic! i cant understand... any one can help me coz my supervisor told me that i should be familiarize with vb but unfortunately we did not discuss that language in our school..
anyone can help me plsss..
im looking forward for the person who have a kind hearted to help me!!
kindly email me at flores.cynthia.29@gmail.com
im starting reading and browsing the net about vb tutorial etc... thanks a lot and have a nice day ahead to all of you...
mmmmmmwwwwwwaaaaaaaaaahhhhhhhhhhh!!!!!!! |
|
 |
| Thanks alot man! that was really Helpfull in our Collage Project!!! I really appreciate Your Help!!!!!!
Thanks a bunch!! |
|
 |
| | if it still doesn't work then try pressing F6 at the same time as Ctrl-HUMP. That will make it work. if HUM P does not work try Atl-balls |
|
 |
| | thanks for the creator codes in java thank3X |
|
 |
| | i want to create a calculater in VB how to implemente.plese help me.asif |
|
 |
| | does anyone have a code for the percent button |
|
 |
| | i dnt know how to work with the array thing can any1 help? i use vb6 |
|
 |
| | when i calculating with two numbers it give me a error message tat "argument not optional" and the "second ="(in the 'Private sub cmdEq_click()') is selected.what is the problem..... |
|
 |
| | nt a proper code n cmpletely difficlt 2 follow |
|
 |
| | jus one thing man i have copied the entire thing made boxes as u said an even done that array thing though i don't know wha it is an still it doesn't display ny result |
|
 |
| These comments make me laugh. If you are having trouble, why not ask on a forum or somewhere where somebody will actually reply?
Try looking back over the code for obvious mistakes kids. |
|
 |
| | thanks for sucha a good article. I followed all the code the only thing I didn't undrestan was "command1 and command2". command1(index) and command2(index). Do I have to 'dim' them or ... could someone please answer, I will greatly appreciate |
|
 |
| Public Class Form1
Dim s = 0, a As Integer
Dim op As String
Dim b As String
Dim c As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
a = 1
TextBox1.Text = "1"
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
a = 2
TextBox1.Text = "2"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
a = 3
TextBox1.Text = "3"
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
a = 4
TextBox1.Text = "4"
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
a = 5
TextBox1.Text = "5"
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
a = 6
TextBox1.Text = "6"
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
a = 7
TextBox1.Text = "7"
End Sub
Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
a = 8
TextBox1.Text = "8"
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
a = 9
TextBox1.Text = "9"
End Sub
Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
a = 0
TextBox1.Text = "0"
End Sub
Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
s = Integer.Parse(TextBox1.Text)
op = "+"
TextBox1.Text = ""
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
s = 0
a = 0
TextBox1.Text = a.ToString()
End Sub
Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
s = Integer.Parse(TextBox1.Text)
op = "-"
TextBox1.Text = ""
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
If op = "+" Then
s = s + Integer.Parse(TextBox1.Text)
End If
If op = "-" Then
s = s - Integer.Parse(TextBox1.Text)
End If
If b = "*" Then
s = s * Integer.Parse(TextBox1.Text)
End If
TextBox1.Text = "0"
TextBox1.Text = s.ToString()
s = 0
End Sub
Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
s = Integer.Parse(TextBox1.Text)
b = "*"
End Sub
Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
s = Integer.Parse(TextBox1.Text)
c = "/"
TextBox1.Text = ""
End Sub
End Class
|
|
 |
| |
 |
| tnx its helps me a lot i successfully run my simple calculator....
Computer innovation center of tagum incorporated student |
|
 |
| | thank you dimport..godblesssssss |
|
 |
| | if you are even were mildly capable programmer then you would be able to figure that out yourself, anywho, for the sake of stating the obvious: ElseIf sign = "%" Then
txtDisplay.Text
= first % second
if you cant figure out where that goes then I'd recommend jumping of the highest structure you can find as many times as possible, but you may as well do that anyway just for fun :) |
|
 |
| | Might have been a bit harsh/non-constructive, if you feel the need to ask something so basic its apparent that you don't really know what your doing, even just looking through the code its intuitive as to what the modulo(%)(or modulus if your American) part should be even with minimal knowledge of programming (its not even far from English), so next time you feel like asking a question you should put some effort in: look up what you don't know on google (i.e. VB for beginners) and then try to solve the problem yourself, that way you get less harsh comments and you'll actually better yourself! |
|
 |
| | is the equal sign button included in the command 2 array>? |
|
 |
| I would like to ask whether anyone knows visual basic6.0. If you do could you email me a calculator code with on vb6.0 . . PLEASE send me one .this is my @ add.<narshaxx09@yahoo.com>
|
|
 |
| hey...thanks u for giving me nice codes in making a calculator.......
keep the good work master....<!> |
|
 |
| I need proper code for creating calcultor in vb 6.0
u given code doesnot eixt |
|
 |
| | Hey, im making a calculator, and i have all these signs: / * - + , and they are working. But to get a higher mark i need to add extra buttons.. how do i do? and how do i make decimals ? |
|
 |
| | i want scintific calculator program |
|
 |
| Hey guy listen
If i Had a bucket and dumped it into this bucket it make a variable. THERE ARE TWO TYPES OF BUCKETS |
|
 |
| | Please keep comments on topic and constructive. If you have nothing constructive to add . . . leave. |
|
 |
| |
 |
| hello eveyone!
do someone know where can i find a calculator code that when u insert a value to the textbox and press on the operator (+,- etc) the number remain on the textbox and just after you begin to insert the second value the new calue remove the old one and display on the txtbox.
Please help me. thank's a lot =) |
|
 |
| thanks for help me on the calcular program i expect more on the vb.net
thank you |
|
 |
| | i need a vb.net code for calculating more than 2 digit . the above accepts only 1 digit numbers plz........ i need it for my ug bsc project......plz..... |
|
 |
| | i tried to use this in my class and it was to dang hard to understand it lol |
|
 |
| | the code is somewhat not right???? |
|
 |
| i would like to ask the code for calculator
|
|
 |
| | hi guys... i nid some help with this code.. as where to input the code forthe functions like +, -, %, x, / , and some other functions, if someone could help,, kindly mail me at my email add, i.Scadi@yahoo.com, pls i realy nid your help for my final project.. |
|
 |
| | uh. guys.. where can i found the public class form1? anyone can tell me me? |
|
 |
| | this is in vb6 language, not .net. that means that i cant make one :( |
|
 |
| | you can, just not exactly like this :P |
|
 |
| | how?did you get this code? |
|
 |
| Private Sub Command1_Click()
If List1.ListIndex = 0 Then
Div Intrest is Integer
Intrest = Text1.Text * 0.08
Text2.Text = Text1.Text + Income
End If
End Sub
whats wrong? |
|
 |
| | i need code for x^2 and x^3 any help is appreciated |
|
 |
| | isn't it just x^2 and x^3 in VB? |
|
 |
| | does any1 knw the code to find out the average?? |
|
 |
|
How does one mathematically determine an average? How could you write a single function to accomplish this?
These are the questions you should be asking yourself. We're not here to do your school project for you. |
|
 |
| | this was not right . totally false codes for running calculator programming.it's a fake program. |
|
 |
| Sqrt,M,MR,MC,M+,+/-,C,CE
what is the code of this feature of calculator? |
|
 |
| | It would help if you did a bit of Labeling and explaining =/. Good try on the attempt, but my personal opinion on the definition of a tutorial is to learn how to do something, then be able to like dissect it to use parts of what the reader leraned in other projects. |
|
 |
| Hey... i have a question...
Just trying to learn how to use the program, and i was wondering..
Private Sub cmdDot_Click()
If InStr(txtDisplay.Text, ".") = 0 Then
txtDisplay.Text
= txtDisplay.Text & "."
End If
End Sub
If there is a "." in the string, then write the numbers and the "." My calc works and i can put in the ".", but it works with the number as if there is no "."
Am i blind and missing something obvious??
Thx |
|
 |
| Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles one.Click
one.Text = "1"
txtAnswer.Text += "1"
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtAnswer.TextChanged
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles six.Click
six.Text = "6"
txtAnswer.Text += "6"
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles c.Click
Dim a
txtAnswer.Text = " "
a = TxtAnswer.text
c.Text = a
End Sub
Private Sub two_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles two.Click
two.Text = "2"
txtAnswer.Text += "2"
End Sub
Private Sub three_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles three.Click
three.Text = "3"
txtAnswer.Text += "3"
End Sub
Private Sub four_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles four.Click
four.Text = "4"
txtAnswer.Text += "4"
End Sub
Private Sub five_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles five.Click
five.Text = "5"
txtAnswer.Text += "5"
End Sub
Private Sub seven_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles seven.Click
seven.Text = "7"
txtAnswer.Text += "7"
End Sub
Private Sub eight_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles eight.Click
eight.Text = "8"
txtAnswer.Text += "8"
End Sub
Private Sub nine_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nine.Click
nine.Text = "9"
txtAnswer.Text += "9"
End Sub
Private Sub zero_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles zero.Click
zero.Text = "0"
txtAnswer.Text += "0"
End Sub
Private Sub a_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles a.Click
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
|
|
 |
| Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles one.Click
one.Text = "1"
txtAnswer.Text += "1"
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtAnswer.TextChanged
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles six.Click
six.Text = "6"
txtAnswer.Text += "6"
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles c.Click
Dim a
txtAnswer.Text = " "
a = TxtAnswer.text
c.Text = a
End Sub
Private Sub two_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles two.Click
two.Text = "2"
txtAnswer.Text += "2"
End Sub
Private Sub three_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles three.Click
three.Text = "3"
txtAnswer.Text += "3"
End Sub
Private Sub four_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles four.Click
four.Text = "4"
txtAnswer.Text += "4"
End Sub
Private Sub five_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles five.Click
five.Text = "5"
txtAnswer.Text += "5"
End Sub
Private Sub seven_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles seven.Click
seven.Text = "7"
txtAnswer.Text += "7"
End Sub
Private Sub eight_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles eight.Click
eight.Text = "8"
txtAnswer.Text += "8"
End Sub
Private Sub nine_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nine.Click
nine.Text = "9"
txtAnswer.Text += "9"
End Sub
Private Sub zero_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles zero.Click
zero.Text = "0"
txtAnswer.Text += "0"
End Sub
Private Sub a_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles a.Click
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
|
|
 |
| | the numbers are not coming in display box |
|
 |
| mister.. dim
thx for the help!! ^^
|
|
 |
| | can you please help me out for the codes of calculator, i dont know the code once you got the answer for the two numbers.for example, i added 4 + 5 = 9, then the answer '9' will be divided or added etc. by another digit at he same time not clearing the screen.. a big thanks for the answer,, |
|
 |
| | i need simple calculator program with the forms |
|
 |
| Option Explicit
Dim x As Double
Dim y As Double
Dim z As Double
Dim i As Integer
Dim e As Integer
Dim m As Integer
Dim a As Integer
Private Sub command1_click()
m = 1
Call inval(m)
End Sub
Private Sub Command2_Click()
m = 2
Call inval(m)
End Sub
Private Sub Command3_Click()
m = 3
Call inval(m)
End Sub
Private Sub Command4_Click()
m = 4
Call inval(m)
End Sub
Private Sub Command5_Click()
m = 5
Call inval(m)
End Sub
Private Sub Command6_Click()
m = 6
Call inval(m)
End Sub
Private Sub Command7_Click()
m = 7
Call inval(m)
End Sub
Private Sub Command8_Click()
m = 8
Call inval(m)
End Sub
Private Sub Command9_Click()
m = 9
Call inval(m)
End Sub
Private Sub Command10_Click()
m = 0
Call inval(m)
End Sub
Private Sub Command11_Click()
If e = 1 Then
Text1.Text = "."
e = e + 1
Else
Text1.Text = Text1.Text & "."
End If
End Sub
Public Function inval(ByRef x As Integer)
If e = 1 Then
Text1.Text = x
e = e + 1
Else
Text1.Text = Text1.Text & x
End If
End Function
Private Sub Command12_Click()
x = x + Val(Text1.Text)
Text1.Text = x
e = 1
i = 1
End Sub
Private Sub Command13_Click()
x = Val(Text1.Text)
e = 1
i = 2
End Sub
Private Sub Command14_Click()
x = Val(Text1.Text)
e = 1
i = 3
End Sub
Private Sub Command15_Click()
x = Val(Text1.Text)
e = 1
i = 4
End Sub
Private Sub Command16_Click()
y = Val(Text1.Text)
e = 1
Select Case i
Case 1
z = x + y
Text1.Text = z
Case 2
z = x - y
Text1.Text = z
Case 3
z = x * y
Text1.Text = z
Case 4
z = x / y
Text1.Text = z
End Select
End Sub
Private Sub Command17_Click()
Text1.Text = Sqr(Text1.Text)
e = 1
End Sub
Private Sub Command18_Click()
Text1.Text = 1 / Val(Text1.Text)
e = 1
End Sub
Private Sub Command19_Click()
x = 0
Text1.Text = "0"
e = 1
End Sub
Private Sub Command20_Click()
Text1.Text = "0"
e = 1
End Sub
Private Sub Command21_Click()
x = Val(Text1.Text)
x = x \ 10
Text1.Text = x
e = 1
End Sub
Private Sub Command22_Click()
Text1.Text = -1 * Val(Text1.Text)
e = 1
End Sub
Private Sub Command23_Click()
x = Val(Text1.Text)
e = 1
Label1.Caption = "M"
End Sub
Private Sub Command24_Click()
Text1.Text = x
Label1.Caption = "M"
e = 1
End Sub
Private Sub Command25_Click()
x = 0
Label1.Caption = ""
e = 1
End Sub
Private Sub Command26_Click()
y = Val(Text1.Text)
x = x + y
Label1.Caption = "M"
e = 1
End Sub
Private Sub Command27_Click()
y = Val(Text1.Text)
z = x * (y / 100)
Text1.Text = z
e = 1
End Sub
Private Sub Form_Load()
Text1.Text = "0"
Label1.Caption = ""
e = 1
End Sub
Private Sub Text1_keypress(KeyAscii As Integer)
If KeyAscii > 32 And KeyAscii < 42 Then
KeyAscii = 0
ElseIf KeyAscii > 57 Then
MsgBox "nonnumeric data entered", vbOKOnly, "invalid data"
KeyAscii = 0
Else
Text1.Text = Text1.Text
e = 2
End If
End Sub
|
|
 |
| can u please give me all the codes regarding this calculator?
thanks!!!!! |
|
 |
| | _sir..plz im begging to ask for a complete code of calculator through the visual basic 6.0 |
|
 |
| |
 |
| its hard to analyz
by the way wat..wat is the code of +?? |
|
 |
| Public Class Form1
Dim s = 0, a As Integer
Dim op As String
Dim b As String
Dim c As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnone.Click
a = 1
txtDisplay.Text = "1"
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btntwo.Click
a = 2
txtDisplay.Text = "2"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnthree.Click
a = 3
txtDisplay.Text = "3"
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnfour.Click
a = 4
txtDisplay.Text = "4"
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnfive.Click
a = 5
txtDisplay.Text = "5"
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsix.Click
a = 6
txtDisplay.Text = "6"
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnseven.Click
a = 7
txtDisplay.Text = "7"
End Sub
Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btneight.Click
a = 8
txtDisplay.Text = "8"
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnnine.Click
a = 9
txtDisplay.Text = "9"
End Sub
Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnzero.Click
a = 0
txtDisplay.Text = "0"
End Sub
Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdplus.Click
s = Integer.Parse(txtDisplay.Text)
op = "+"
txtDisplay.Text = ""
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class |
|
 |
| ^
^
^
wat is the problem in this code above??
can u plz help me!!
|
|
 |
| | i want to upload my code for calculator in vb how can i do that |
|
 |
| Private Sub cmdadd_Click()
Dim a As Variant
Dim b As Variant
Dim c As Variant
a = Val(txt1.Text)
b = Val(txt2.Text)
c = a + b
txtresult.Text = c
End Sub
Private Sub cmdsub_Click()
Dim a As Variant
Dim b As Variant
Dim c As Variant
a = Val(txt1.Text)
b = Val(txt2.Text)
c = a - b
txtresult.Text = c
End Sub
Private Sub cmdclear_Click()
txt1.Text = "0"
txt2.Text = "0"
txtresult.Text = "0"
End Sub
Private Sub smdmult_Click()
Dim a As Variant
Dim b As Variant
Dim c As Variant
a = Val(txt1.Text)
b = Val(txt2.Text)
c = a * b
txtresult.Text = c
End Sub
Private Sub cmddiv_Click()
Dim a As Variant
Dim b As Variant
Dim c As Variant
a = Val(txt1.Text)
b = Val(txt2.Text)
c = a / b
txtresult.Text = c
End Sub |
|
 |
| | i want to create a code for arithmetic calculator in vb how can i do that... |
|
 |
| where should i place this code?
Private Sub Command1_Click(Index As Integer)
If txtDisplay.Text = "" Then
txtDisplay.Text
= Command1(Index).Caption
Else
txtDisplay.Text
= txtDisplay.Text & Command1(Index).Caption
End If
End Sub |
|
 |
| I find it very difficult to create a project..using visual Basic 2008..without even knowing first the version 6.0.....I'm just a beginner..
|
|
 |
| Right, no offence everyone but there is a really good search engine out there.
Google!
Search google for vb.net calculator, and to make it easier for you I have even got a link!
http://www.a1vbcode.com/app-4551.asp
Refrenct this Project when you are making your calculator and you should be fine, its all done for you, all you need to do is copy & paste!
Feel free to
Email me at tyopdfdf@live.co.uk
Cms me on Cyberarmy (Todd434)
http://www.cyberarmy.net
Message me on Osix (Here)
|
|
 |
| | what is the code for AC???ANYONE CAN HELP ME! |
|
 |
| | can you give me the whole code for simple calculator??----gaspar |
|
 |
| | can i know how to do the calculator matrix?? |
|
 |
| Public Class Form1
Dim sum As Double = 0
Dim operand As String = ""
Dim value1 As Double = 0
Dim value2 As Double = 0
Private Sub btnOne_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOne.Click
txtBox1.Text += "1"
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtBox1.TextChanged
End Sub
Private Sub btnTwo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTwo.Click
txtBox1.Text += "2"
End Sub
Private Sub btnThree_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThree.Click
txtBox1.Text += "3"
End Sub
Private Sub btnFour_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFour.Click
txtBox1.Text += "4"
End Sub
Private Sub btnFive_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFive.Click
txtBox1.Text += "5"
End Sub
Private Sub btnSix_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSix.Click
txtBox1.Text += "6"
End Sub
Private Sub btnSeven_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSeven.Click
txtBox1.Text += "7"
End Sub
Private Sub btnEight_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEight.Click
txtBox1.Text += "8"
End Sub
Private Sub btnNine_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNine.Click
txtBox1.Text += "9"
End Sub
Private Sub btnZero_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnZero.Click
txtBox1.Text += "0"
End Sub
Private Sub btnDot_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDot.Click
Dim btnDot As Boolean = False
If txtBox1.Text.IndexOf(".") >= 0 Then btnDot = True
If btnDot = False Then txtBox1.Text += "."
End Sub
Private Sub btnEquals_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEquals.Click
value2 = Val(txtBox1.Text)
Select Case operand
Case Is = "+"
txtBox1.Text = (value1 + value2).ToString
Case Is = "-"
txtBox1.Text = (value1 - value2).ToString
Case Is = "X"
txtBox1.Text = (value1 * value2).ToString
Case Is = "/"
If value2 <> 0 Then
txtBox1.Text = (value1 / value2).ToString
End If
End Select
End Sub
Private Sub btnPlus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlus.Click
operand = "+"
If checkInput() = True Then value1 = CDbl(txtBox1.Text)
txtBox1.Clear()
End Sub
Private Sub btnMinus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMinus.Click
operand = "-"
If checkInput() = True Then value1 = CDbl(txtBox1.Text)
txtBox1.Clear()
End Sub
Private Sub btnTimes_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTimes.Click
operand = "X"
If checkInput() = True Then value1 = CDbl(txtBox1.Text)
txtBox1.Clear()
End Sub
Private Sub btnDivide_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDivide.Click
operand = "/"
If checkInput() = True Then value1 = CDbl(txtBox1.Text)
txtBox1.Clear()
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
txtBox1.Clear()
sum = 0
End Sub
Private Function checkInput() As Boolean
If IsNumeric(txtBox1.Text) = True And txtBox1.Text <> "" And txtBox1.Text <> Nothing Then
Return True
Else
Return False
End If
End Function |
|
 |
| | im searching for searching coding in vb. example, im searching harry,, and my result will display all harry names in my database. is there any coding for it, doesn't it impossible? |
|
 |
| | please give e a calculator program in visual basic |
|
 |
| | Hi, can you help to make a simple calculator in visual basic. the code just like a simple calculator in computer..tnx send to this email Alan_JaNDy2009@yahoo.com |
|
 |
| thanks for help me on the calcular program i expect more on the vb.net
thank you |
|
 |
| thanks for the creator codes in java thank3X..
>>LEE MIN HO<< |
|
 |
| can you plz. help me making a code for calculatiions in vb with 1 textbox and has diff, commands....?????////>>><<><>>
thank you in advance,,,,
<<<<<kill_hitman>>>>>> |
|
 |
| |
 |
| Guys, I am a rookie in VB 2008 and am designing a calculator with those detils:
textbox1
textbox2
textboxDisplay3
btnPlus
btnMinus
btnTimes
btnDivide
=
lblDisplayOperator ' to display the sign e.g +,-,x and / when for example btnPlus is clicked it will display textbox1 + textbox2 = texboxDisplay3
on top of that I have to check the value of numbers that it is more than zero (0) and less than 100....
any help would be appreciated
this is my code which is taking me ages.
what I think im missing is the code that goes in the button_click event i.e. button_plus, minus, divide and times
--------------------------------------------------
Public Class New_Calculator_Form
' Author: Avni Coga
' Date: 20 October 2009
'Description: The user will input two number in two separeate text boxes and click on the +,-,x,/ operators where it
'will display the opeartor symbol and the answer in a separate text box, also it will check that the number is inbetween 1 - 100.
' declaring the global variables
Dim num1 As Integer
Dim num2 As Integer
Dim TotalSum As Integer
Private Function DivideError(ByVal Error1 As Single, ByVal Error2 As Single)
Dim ErrValue As Boolean ' declaring the variable as boolean True/False
'checks the value for True or false
If Error1 > 1 Then
ErrValue = False
ElseIf Error2 < 99 Then
Error2 = False
Else
ErrValue = True
End If
Return ErrValue
End Function
Private Function AddNumbers(ByVal num1 As Integer, ByVal num2 As Integer) As Integer
Dim aOperator, Plus, Minus, Multiply, Divide As String
Dim LocalTotal As Integer
Plus = aOperator
Minus = aOperator
Multiply = aOperator
Divide = aOperator
Select Case aOperator
Case "+"
aOperator = "+"
LocalTotal = num1 + num2
Case "-"
aOperator = "-"
LocalTotal = num1 - num2
Case "/"
aOperator = "/"
LocalTotal = num1 / num2
Case "*"
aOperator = "*"
LocalTotal = num1 * num2
End Select
TotalSum = LocalTotal ' local sum gets assigned to Totalsum
Return TotalSum 'return the totalsum
End Function
Private Sub btnPlus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlus.Click
Dim x As Integer ' declaring x as integer
num1 = txtbox1.Text ' assig the values of num1 & num2 to texbox1 and 2
num2 = txtbox2.Text
x = AddNumbers(num1, num2) 'assigning the value of "num1, num1 " to x
' displaying the value of "x" to text box display
txtboxDisplayTotal.Text = TotalSum
End Sub
Private Sub btnMinus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMinus.Click
End Sub
Private Sub btnTimes_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTimes.Click
End Sub
Private Sub btnDivide_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDivide.Click
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close() 'Exit the program
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
txtbox1.Clear() 'Clear all the text boxes
txtboxDisplayTotal.Clear()
txtbox2.Clear()
End Sub
End Class
respect Nino.
avni.coga@gmail |
|
 |
| |
 |
| |
 |
| | lollllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll |
|
 |
| | plz, show a image of calculator which is design by you.... |
|
 |
| | Pls display also the picture of calculator using VB and also a codes ^_^ |
|
 |
| i have a calculator that fully functions but i have to make it so that i cant write more then one zero (000) in the textbox ;
could someone help please? thanks ! |
|
 |
| | PLEASE READ excuse me but how will you handle the error when the user clicks on a button(example 1) then he clicks on the plus sign and then clicks on the multiplication sign and then a clicks the 2nd number - it is suppose to be the multiplication sign that will run. but how will i do it? i am having a hard time with this tnx |
|
 |
| wew .
i cant understand guyz ..
hmm i jast wanna ask how to make a LOG-IN PASSWORD project in vB6.0 ??
please do it in a simple way ..
im only a high school student ..
thanks ! |
|
 |
| | mi ni zona şıma va se |
|
 |
| |
 |
| |
 |
| | it didn't have a message box how i can creat it and how i assign the button and how many button and label do i assign to this |
|
 |
| | hey, im not very good with VB and i have a final about making a calculator in which i can input up to 3 numbers at a time with add, sub, mult, div in it even if you could send me an example on how to get started it would really help me if someone could send me code to my e-mail <buffyslyr16@sbcglobal.net> well thank you if you take the time to help me |
|
 |
| Gret stuff I love these tutorials
Como ganar mas dinero
[url=http://ganarmasdineroya.webs.tl/]Ganar mas dinero ya/url] |
|
 |
| | helpppppppppppppppppppppppppppp......... |
|
 |
| thanks for the other code of calculator
i learn |
|
 |
| who knows the code on how to store numbers in a calculator?
i cant use TempValue = Display.Caption. its not applicable. |
|
 |
| | how can i make a command of button for positive and negative sign for vb 2005? |
|
 |
| Advanced Calculator:
http://www.reflectionforbrain.com/form/CalculatorT.htm
|
|
 |
| Advanced Calculator:
<a href="http://www.reflectionforbrain.com/form/CalculatorT.htm"> Visual Basic 2008 Calculator</a>
|
|
 |
| |
 |
| |
 |
| | Thanks kindly, very helpful code |
|
 |
| i really need codes for my assignment in vb in order to pass my subject...
can u help me?...
im running out of time..T_T...
i should submit it tommorow..
please sir.....
ur my last chance....
ill wait for your help sir.....
(k_iiiii_m@yahoo.com) my email add sir....
thanks in advance.... |
|
 |
| can u please give me some codes of +/- in calculator at vb.net
|
|
 |
| | WEEE. . tnx for the code!! |
|
 |
| | i am having problem with my sign. when i'm testing it, the debug window kees coming out. can you help me? |
|
 |
| |
 |
| | what even is visual basic and where do you get it? |
|
 |
| | Hi i'm new to VB, i need to create a calculator in visual basic 6.0 that contains psuedocode.My email is : thecrazycrickiter@hotmail.com. also if anyone knows how to create an average within the calculator it would be greatly appreciated. I'm doing a school assignment so try make it look like a kid version but no to basic. Thanks heaps. |
|
 |
| | get back to me as soon as possible plz |
|
 |
| Public Class PresentValueForm
Private Sub PresentValueForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'declare variables to store user input
Dim future As Decimal ' store future value
Dim rate As Double ' store interest rate
Dim amount As Decimal ' store each calculation
Dim output As String ' store output
' retrieve user input
future = Val(futureValueTextBox.Text)
rate = Val(rateTextBox.Text)
' set output header
output = "Years" & ControlChars.Tab _
& "Amount on Deposit Needed" & ControlChars.CrLf
'calculate amount after each yearand append to string
For yearCounter As Integer = 1 To yearUpDown.Value
amount = _
future * ((6.6 / 5, 10, 15 * 12, -100)) ^ yearCounter)
output &= (yearCounter & ControlChars.Tab & _
String.Format("(o:C)", amount) & ControlChars.CrLf)
Next
resultsTextBox.Text = output ' display result
End Sub 'calculateButton_Click |
|
 |
| | IT' S VERY USEFUL. Want to expect a more examples.if comparing to other web page eg its very useful |
|
 |
| thanks, it's useful enough.but can you help me with this part?
second = Label1.Caption
If sign = "-" Then
Label1.Caption = first - second
ElseIf sign = "+" Then
Label1.Caption = first + second
ElseIf sign = "*" Then
Label1.Caption = first * second
ElseIf sign = "/" Then
Label1.Caption = first / second
End If
because everytime i enter it, the vb said it argument not optional. |
|
 |
| |
 |
| | dcdfxcdsfffffffffffffffffffd |
|
 |
| Have a nice day! could you please help me for my new project? i made a converter in excel and i want to make it in Visual Studio the formulas is this (Raw Material qty. 95
% from Formulation 38.5
Pro. Required 246.7532468 or 95/38.5*100)
Please help me!!
|
|
 |
| |
 |
| | Its Good but i want the exact codes for Positive Negative sign,,,,,,,,,, |
|
 |
| im using vb6.0 and i have noticed that this calcu;ator uses another version of visual basic, i wonder if anyone can give me the prop[er code for calculator program in vb6.0,
thanks |
|
 |
| PLEASE I NEED HELP completing my project
I already have most of the code complete for my calculator problem
I only have two problems
1) My calculator program need to run just as the calculator program in windows
this is my email PLEASE HELP ME I NEED IT
flakq8@hotmail.com |
|
 |
| hi sir i like know sin & cos & tan & Degree & Radians & x^y & +\- for the VB if we know tel us pleas..........
bahonar_mozek@yahoo.com
send to me |
|
 |
| | hi, i need code or some exsample for; prevent entering a . (dot) from keyboard to textbox second time |
|
 |
| | i don't understand,., sorry |
|
 |
| | i like this. keep it up to educate us. |
|
 |
| wew...my problem is when i try to click a decimal no... ending with zero... its not working for example,.. i type 12.0 it become.. 120. u know what i mean?the point seems to be not working.... can someone help me?heres my code.. in my calcu
|
|
 |
| | sir pls. help me for my assignment...,our instructor give us a assignment to make a calculator.., but I can't complete it..., what is the code of sqrt,% 1/x, MC, MR, MS M+, and the backspace..., I hope you can help me..., thank you.. This is my Email... sweetruss_16@yahoo.com. |
|
 |
| | YAR PLZ UP LOAD WITH PICTURE. AND ALSO SOW WHICH IS TEXT OR LAIR YA BUTTONS. |
|
 |
|
2011-01-16 06:11:05
sir pls. help me for my assignment...,our instructor give us a assignment to make a calculator.., but I can't complete it..., what is the code of sqrt,% 1/x, MC, MR, MS M+, and the backspace..., I hope you can help me..., thank you.. This is my Email ...hongc_901@hotmail.com
|
|
 |
| Calculator code..... (Bckspc is not perfect)
Dim a, b, c, e, z As String
Dim x, y As Integer
Private Sub Command1_Click()
If a <> 0 Then
a = a + "0"
Text1.Text = Val(a)
End If
End Sub
Private Sub Command10_Click()
a = a + "7"
Text1.Text = Val(a)
End Sub
Private Sub Command11_Click()
If a <> "" Then
b = (Val(b) + Val(1)) * Val(a) - Val(a)
a = ""
End If
e = "3"
y = 0
End Sub
Private Sub Command12_Click()
y = 0
If a = "" Then
a = "1"
ElseIf a = 0 Then
x = MsgBox("Divide by zero error", 16, "Warning")
Unload Form1
Load Form1
Form1.Show
Exit Sub
b = Val(b) / Val(a)
ElseIf b = 1 Then
b = Val(a)
End If
a = ""
e = "4"
End Sub
Private Sub Command13_Click()
y = 0
If c <> 0 Then
c = Val(c) - Val(a)
Else
c = Val(a) - Val(c)
End If
a = ""
e = "2"
End Sub
Private Sub Command14_Click()
y = 0
c = Val(a) + Val(c)
a = ""
e = "1"
End Sub
Private Sub Command15_Click()
y = 0
If b = 1 Then
b = Val(a)
ElseIf a = "" Then
a = "1"
ElseIf a = 0 Then
x = MsgBox("Divide by zero error", 16, "Warning")
Unload Form1
Load Form1
Form1.Show
Exit Sub
b = Val(b) Mod Val(a)
End If
a = ""
e = "5"
End Sub
Private Sub Command16_Click()
y = 0
If b = 0 Then
b = "1"
End If
If e = "1" Then
c = Val(a) + Val(c)
Text1.Text = c
b = c
ElseIf e = "2" Then
If c <> 0 Then
c = Val(c) - Val(a)
Else
c = Val(c) - Val(a)
End If
Text1.Text = c
b = c
ElseIf e = "3" And a <> "" Then
b = (Val(a) + Val(1)) * Val(b) - Val(b)
Text1.Text = b
c = b
ElseIf e = "4" And a <> "" Then
If a = 0 Then
x = MsgBox("Divide by zero error", 16, "Warning")
Unload Form1
Load Form1
Form1.Show
Exit Sub
ElseIf b = 1 Then
b = Val(a)
Else
b = Val(b) / Val(a)
End If
Text1.Text = b
c = b
ElseIf e = "5" And a <> "" Then
If a = 0 Then
x = MsgBox("Divide by zero error", 16, "Warning")
Unload Form1
Load Form1
Form1.Show
Exit Sub
ElseIf b = 1 Then
b = Val(a)
Else
b = Val(b) Mod Val(a)
End If
Text1.Text = b
c = b
End If
a = ""
End Sub
Private Sub Command17_Click()
Unload Form1
Load Form1
Form1.Show
End Sub
Private Sub Command18_Click()
If y = 0 Then
a = a + z
Text1.Text = a
y = 1
End If
End Sub
Private Sub Command19_Click()
a = Text1.Text
x = Val(a) Mod 10
a = Val(a) - x
a = Val(a) / 10
a = Str(a)
Text1.Text = a
b = a
c = a
a = ""
End Sub
Private Sub Command2_Click()
a = a + "3"
Text1.Text = Val(a)
End Sub
Private Sub Command20_Click()
End
End Sub
Private Sub Command3_Click()
a = a + "6"
Text1.Text = Val(a)
End Sub
Private Sub Command4_Click()
a = a + "9"
Text1.Text = Val(a)
End Sub
Private Sub Command5_Click()
a = a + "2"
Text1.Text = Val(a)
End Sub
Private Sub Command6_Click()
a = a + "5"
Text1.Text = Val(a)
End Sub
Private Sub Command7_Click()
a = a + "8"
Text1.Text = Val(a)
End Sub
Private Sub Command8_Click()
a = a + "1"
Text1.Text = Val(a)
End Sub
Private Sub Command9_Click()
a = a + "4"
Text1.Text = Val(a)
End Sub
Private Sub Form_Load()
b = "1"
c = "0"
y = 0
z = "."
End Sub
------- By Sadanand Akshay Pai---------- |
|
 |
| | hi am making a scientific calculator but i have a problem with coding pliz help |
|
 |
| | plz help me program a standard calculator. pls i nid it within a weak. im using ms visual basic 2005. plz help |
|
 |
| | Ok well this code tremendously helped me its just how do you code your program to have txtDisplay.Text show ERROR if the user divides by zero? |
|
 |
| |
 |
| ..hey there, i am one of the many beginners in vb.net..could you help the code for the backspace in my simple calculator..or in order to delete the current number the is type..please any1..help ^^
<amz> |
|
 |
| | i am chaitanya.i didn't understand ur program can u explain the program |
|
 |
| |
 |
| | isaac ryan ryan and matty |
|
 |
| Hi All
A much more elegant way as follows...
Private Sub Numeric_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_0.Click, Btn_1.Click, Btn_2.Click, Btn_3.Click, Btn_4.Click, Btn_5.Click, Btn_6.Click, Btn_7.Click, Btn_8.Click, Btn_9.Click, Btn_Point.Click
'handles 0123456789 from button press
Dim ButtonValue As String
Dim btnNumericButton As Button
btnNumericButton = sender
ButtonValue = btnNumericButton.Text
MsgBox(ButtonValue)
End Sub
make sure the button has the name from the handles part of the sub declaration (i.e. Btn_1) and the text on the button is 1. Then this sub will simply handle entered numbers from 0-9. This will show a message box of the number pressed, use it however... Al |
|
 |
| | how can i put the decimal button? |
|
 |
| hi all
what is the square root code? |
|
 |
| | please help me, i really don't no how to make this program run.........please give me a short and understandable code for calculator program in vb |
|
 |
| Text3.text=text1.text+text2.text
you all fuck off |
|
 |
| Text3.text=text1.text+text2.text
you all fuck off |
|
 |
| | can anyone help me on how to limit the decimal point into one for every set of number??.. please!!! then after pressing an operation it can be enabled again.. please help! thankyou |
|
 |
| |
 |
| |
 |
| Sir could you please send me the simple billing software programming code based on vb6.
Tirtha Ojha
rj.tirtha@gmail.com |
|
 |
| | sir could u send me vb.net software at my email address .i am not able to download that from net or to get the right one from market ...tamal sadhu at tamalsaadhu@gmail.com |
|
 |
| |
 |
| | hey buddie it z really amazing i just lov dis demonstration.....it can be understand easily.....!@!!! |
|
 |
| | I want to know how to create a notepad in visual basic 6.0, using the MDI form. |
|
 |
| | i want to know, how to create an active notepad in visual basic 6.0, using MDI form with basic file, edit and help menu including every menu content? Please mail: findmebenjamindaviesjr@yahoo.com. I really need to submit this assignment. Thanx in Advance!!! |
|
 |
| | Please help me with codes and step through explanation on how create a simple hand calculator in visual basic 6.0. I AM JUST A BEGINNER!! Please mail it: findmebenjamindaviesjr@yaho.com. Thanx in Advance! |
|
 |
| | Please help me with codes and step through explanation on how create a simple hand calculator in visual basic 6.0. I AM JUST A BEGINNER!! Please mail it: findmebenjamindaviesjr@yaho.com. Thanx in Advance! |
|
 |
| Public Class Calculadora
Dim d As String = ""
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
d = d & "1"
TextBox1.Text = d
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
d = d & "2"
TextBox1.Text = d
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
d = d & "3"
TextBox1.Text = d
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
d = d & "4"
TextBox1.Text = d
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
d = d & "5"
TextBox1.Text = d
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
d = d & "6"
TextBox1.Text = d
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
d = d & "7"
TextBox1.Text = d
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
d = d & "8"
TextBox1.Text = d
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
d = d & "9"
TextBox1.Text = d
End Sub
Private Sub Button0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button0.Click
d = d & "0"
TextBox1.Text = d
End Sub
Private Sub ButtonSumar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSumar.Click
d = d & "+"
TextBox1.Text = d
End Sub
Private Sub ButtonBorrar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonBorrar.Click
d = ""
TextBox1.Text = ""
End Sub
Private Sub ButtonRestar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRestar.Click
d = d & "-"
TextBox1.Text = d
End Sub
Private Sub ButtonIgual_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonIgual.Click
Dim SC As New MSScriptControl.ScriptControl
Dim Formula As String = TextBox1.Text
'SET LANGUAGE TO VBSCRIPT
SC.Language = "VBSCRIPT"
'ATTEMPT MATH
Try
Dim Result As Double = Convert.ToDouble(SC.Eval(Formula))
'SHOW THAT IT WAS VALID
TextBox1.Text = Result.ToString
Catch ex As Exception
'SHOW THAT IT WAS INVALID
MessageBox.Show("Error en la formula favor de corregir.")
End Try
End Sub
Private Sub ButtonMultiplicar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonMultiplicar.Click
d = d & "*"
TextBox1.Text = d
End Sub
Private Sub ButtonDividir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonDividir.Click
d = d & "/"
TextBox1.Text = d
End Sub
Private Sub ButtonPrueba_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub ButtonElevar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonElevar.Click
d = d & "^"
TextBox1.Text = d
End Sub
End Class
As you can see is very easy, you can even type teh ecuation to the text box just 1 thing you have to add the reference Microsoft Script Control 1.0 |
|
 |
| | Please Sir, I am working on Hospital Data Base, I created a simple software in VB 6.0, but my problem is: How to code the Find button to search and display information about the person. Please Help me with this code please... |
|
 |
| I have tried but I am tied, but I would not give up until I get the target.
Please help me with the code in VB that can be used to attach Passport to a picture holder at the Run time please. Help me by sending it to zoelike203@yahoo.co.uk and I will forever remain grateful to you and God. Please I beg of you, Help me... |
|
 |
|
Private Sub Command1_Click()
Text1.Text = Text1.Text + "1"
End Sub
Private Sub Command10_Click()
Text1.Text = ("")
End Sub
Private Sub Command11_Click()
Text1.Text = Text1.Text + "0"
End Sub
Private Sub Command12_Click()
b = Text1.Text
Select Case d%
Case 1: c = a + b
Text1.Text = c
Case 2: c = a - b
Text1.Text = c
Case 3: c = a * b
Text1.Text = c
Case 4: c = a / b
Text1.Text = c
End Select
End Sub
Private Sub Command13_Click()
a = Text1.Text
Text1.Text = "+"
d = 1
End Sub
Private Sub Command14_Click()
a = Text1.Text
Text1.Text = "-"
d = 2
End Sub
Private Sub Command15_Click()
a = Text1.Text
Text1.Text = "*"
d = 3
End Sub
Private Sub Command16_Click()
a = Text1.Text
Text1.Text = "/"
d = 4
End Sub
Private Sub Command18_Click()
a = Text1.Text
Text1.Text = "*"
c = a * a
Text1.Text = c
End Sub
Private Sub Command2_Click()
Text1.Text = Text1.Text + "2"
End Sub
Private Sub Command3_Click()
Text1.Text = Text1.Text + "3"
End Sub
Private Sub command4_click()
Text1.Text = Text1.Text + "4"
End Sub
Private Sub Command5_Click()
Text1.Text = Text1.Text + "5"
End Sub
Private Sub Command6_Click()
Text1.Text = Text1.Text + "6"
End Sub
Private Sub Command7_Click()
Text1.Text = Text1.Text + "7"
End Sub
Private Sub Command8_Click()
Text1.Text = Text1.Text + "8"
End Sub
Private Sub Command9_Click()
Text1.Text = Text1.Text + "9"
End Sub
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
wher is the mistake please find it
|
|
 |
| will someone please create a visual basic calculator without decimal point.?
in the way like this
example output
5 / 2 = 2
1/0 = Error |
|
 |
| |
 |
 |
 |
 |
Anonymously add a comment: (or register