-
VB.Net
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
-
Re: VB.Net
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:
Code:
Option Explicit
Dim amount As Integer
Private Sub Command1_Click()
Text1 = ""
amount = amount + 1
Text1.Text = Label1 & " x " & (amount)
End Sub
-
Re: VB.Net
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!!
-
Re: VB.Net
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:
Code:
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.