PDA

View Full Version : VB.Net



Tiffosi2000
11-28-2004, 03:27 PM
Hi,

i am having a problem in vb.
The basic program is that i have a label with a name of something in it. next i have a command button which everytime u press it add 1 to the quantity ordered. on the right i have a textbox.

I want to display the text from with in the labe followed by " x " and then the amount ordered.

I can diplay the amount easily but it will not display the text from the label in the textbox. any ideas??

Thanks

backlash
11-28-2004, 05:24 PM
put the text box on top of the label if you want it IN the label area.

what you'll need to do is this:


Option Explicit
Dim amount As Integer

Private Sub Command1_Click()
Text1 = ""
amount = amount + 1
Text1.Text = Label1 & " x " & (amount)
End Sub

Tiffosi2000
11-30-2004, 10:16 AM
Thanks for that. I kept on trying to display the value of the label!!

Another question;

when i am producing the reults in a textbox on the right of the screen, i want a seperate line for each. For example, there are 3 command buttons and everytime you click them i want the textbox on the right to display the name and quantity ordered. However, when i do it, the 1st works fine but after that it just writes over the text!!

backlash
11-30-2004, 01:18 PM
why don't you use a picture box for that? Makes it a hell of a lot easier than trying to use a text box (which can be edited by the user when there's text in it).

then have the code be:


picOutput.Print Label1 & " x " & amount
picOutput.Print Label2 & " x " & amount2
picOutput.Print Label3 & " x " & amount3

you'll need to put them in their corresponding command button's sub routine.