visaul Basic 2005

مدمنة انترنت 25-09-2008 2 رد 942 مشاهدة
م
السلام عليكم ورحمة الله وبركاته

بنات عندي بروجكت في الكودينق visaul Basic 2005

وابا حد يساعدني ضروري ابا الكودينق

• Create a Calculator. It won't be a very sophisticated calculator, and the only thing it can do is adding up the numbers.

• What the assignment will give you is more confidence in using variables, and shifting values from one control to another.

• When your form design is finished, it might look something like this:




Useful Hints:

1) The Buttons with the Text 0 to 9 only need to do one thing when the button is clicked - have their Text Properties transferred to the Textbox.

2) What happens when you transfer the number 2 to the Textbox, and then click the number 3? The number 2 will disappear, to be replaced by the number 3. What if we need to type 23?

What we need is a way to get whatever is in the Textbox to stay where it is, and not disappear on us when we click a different number. It's quite easy. It's this:
txtDisplay.Text = txtDisplay.Text & btnZero.Text

3) You can place your variable declarations right at the top of the code window, just beneath the line that begins "Inherits … " We'll set up two Integer variables there, total1 and total2.

PublicClass Form1
Inherits System.Windows.Forms.Form

Dim total1 As Integer
Dim total2 As Integer

Now all the controls on your form can see these two variables. Those Buttons you set up can put something in them, and every button has the ability to see what's inside them.

4) For plus button:
Just like the code (varaible1 = variable1 + 1), we need to "tell" our program to remember what was in the variable. We do it like this:

total1 = total1 + Val(txtDisplay.Text)

That Val( ) part just makes sure that a number in a textbox is kept as a number, and not as text. It's short for Value.

5) To erase something from a textbox, just set its Text property to a blank string. We do this with two double quotation marks. Like this:
txtDisplay.Text = “ “

واخيرا شكرا
a
أنا بشتغل على asp.net with VB
ما أعتقد فيني أساعد
م
مشكورة اختي وجزاج الله خير على كل حال
X