lolz
Feb 12, 2009, 12:11 AM
i am a student at college in somaliland. one of my instructors told me to write a small programme for a calculator in visual basic 6.0. so, im stuck with this. help me with the codes.
lolz Feb 12, 2009, 12:11 AM i am a student at college in somaliland. one of my instructors told me to write a small programme for a calculator in visual basic 6.0. so, im stuck with this. help me with the codes. rwinterton Feb 14, 2009, 06:13 AM Start by putting five buttons on a form and a two textboxes to hold numbers. Put "+", "-", "*", "/" and "C" on each of the four buttons (or "Add", "Sub", "Mul", "Div" and "Clear" respectively. Make one textbox "read/only". And put a "0" in the box. That will be the "answer box". Put a "0" in the other box. That will be the "user's box". Name the boxes "txtAnswer" and "txtOperand" Double-click on each key to create a key-click handler. The user will enter a value in his text box and click one of the keys. When he clicks the key, you either add, subtract, multiply, or divide (depending on the key that is clicked) the value in the "answer" box with the number in the user's box. Place the result in the answer box. Here's code for the "+" handler: Dim NewValue as double = cdbl(txtOperand.text) Dim OldValue as double = cdbl(txtAnswer.text) Dim Answer as double ' if the "ADD" button is clicked, add them. Answer = NewValue + OldValue txtAnswer.text = cstr(Answer) Do this for each of the buttons. When the user hits the "Clear" button, put a zero in the "answer" box. nano12 Mar 29, 2009, 03:58 AM Iam a physics student and my professor asked me to write a visual basic 2005 for both standard and scientific calculator and I have no idea what to do please help me Copyright ©2005-, Ask Me Help Desk
|
||||||||