Results 1 to 4 of 4

Thread: VB.Net

  1. #1
    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

  2. Software & Hardware   -   #2
    backlash's Avatar usenet lover
    Join Date
    Aug 2003
    Location
    in your dreams
    Posts
    1,579
    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
    Last edited by backlash; 11-29-2004 at 07:24 PM.

  3. Software & Hardware   -   #3
    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!!

  4. Software & Hardware   -   #4
    backlash's Avatar usenet lover
    Join Date
    Aug 2003
    Location
    in your dreams
    Posts
    1,579
    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.
    Last edited by backlash; 11-30-2004 at 01:22 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •