![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
|
Newbie here...
Ok, so I made my first little program to take a radius value inputted by the user and use it in function with a height value to make a volume formula. Having said this I have very very basic knowledge in VB, I would like to know if anyone could start me off with a code to make a Calculator using only the 0-9 buttons and the "+" "-" "*" and "/". I know how to make a button and set it so when the user pushes this button via the mouse(e.g.1), the user inputs the value of the button into the program and it outputs that value onto the Answerbox. How can I make it so that when the user presses another button (e.g.2) it appears beside the 1 to make "12". I'm thinking that if the value "1" is inserted into the Answerbox and then "2" after that, the Answerbox will show "2" instead of "12" because it's telling the program to set the Answerbox.Text 1 then setting it to 2, erasing the previous digit. How could I make it so that the "1" stays there, allowing additional digits in the same textbox at once?
If you guys have trouble reading this message, just tell me and ill try to retype it in an easier way to read, or clarify things, I'm only 15 and i just took interest in the arts of Programming, Thanks for your time :p |
|
|
|
|
|
#2 |
|
Programmer
Join Date: Apr 2005
Posts: 32
Rep Power: 0
![]() |
|
|
|
|
|
|
#3 |
|
Expert Programmer
Join Date: Dec 2004
Posts: 794
Rep Power: 4
![]() |
If you're just starting off in programming, why not learn a more useful language like VB.net 2003, C# (a lot less typing!) or C++? Pre-.net VB is a bit useless for anything non-trivial, I'm sorry to say.
Anyway, glad to see a someone become interested in programming! |
|
|
|
|
|
#4 |
|
Newbie
|
Hmm the reason why I'm starting VB is because I actually did try C++ and it woudln't cooperate AT ALL. I downloaded Dev-Cpp and EVERY code i copied from the internet, (even short 5 line ones) and pasted in my compiler, it would never compile...always had an error of some sort (It was always on the line where you put a { to begin adding what's inside the program. It pissed me off because I never found a solution, so then i read about VB being easier, but now I see that...well...there's much better stuff out there lol So if someone knows a good c++ compiler other then the cursed Dev's which keeps busting on me...let me know lol.
|
|
|
|
|
|
#5 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
What he's trying to say is, use Visual Basic .NET instead of VB. It's faster, better and more complete.
|
|
|
|
|
|
#6 |
|
Expert Programmer
|
I'd say VB6 is a softer learning curve myself, and it's still the most widely used. It's perfectly possible to do this: in fact it's the classic "second program" (after hello world).
If you can't understand or find source code on psc (planetsourcecode.com) or google, we can talk you through it if you want. |
|
|
|
|
|
#7 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
That's true, but come 2008, say, everyone will be using VB .NET. Anyway, what you want is:
Text1.Text = Text1.Text & Value |
|
|
|
|
|
#8 |
|
Expert Programmer
Join Date: Dec 2004
Posts: 794
Rep Power: 4
![]() |
That's odd, Dev-CPP works for me (although I use Visual Studio 2003)
If you don't have access to VS 2003 (which is better than 2005) you can download the "starter" version of 2005 for free on Microsoft's web site. It has way less features than the full version of Visual Studio, but it's still light years ahead of dev-cpp. And if you must use an "easy" language, use C#. It's just as easy as Visual Basic but it has C-style syntax. It's also actually in high demand in the real world. |
|
|
|
|
|
#9 |
|
Newbie
|
Thanks
Thanks uman, I really needed an easy language to start off in, I think I'll head out to the library tommorow and pick me up a C# book to start training :p
-MuSiG |
|
|
|
|
|
#10 |
|
Expert Programmer
Join Date: Dec 2004
Posts: 794
Rep Power: 4
![]() |
no problem
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|