adding to textbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gobblegob
    New Member
    • Dec 2007
    • 133

    adding to textbox

    Hi all,

    I want to add to a textbox without deleting what is allready there
    for example :


    CmdClick_1
    text1.text = "first"

    CmdClick_2
    text1.text = "second"

    so if you clicked CmdClick_1 and then CmdClick_2 the Textbox
    would say firstsecond.

    VB6.

    Thanks in advanced.
    Gobble.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Before writing to the textbox u need to store the string already in the textbox. Append the second string to first and then display in textbox.

    Comment

    • gobblegob
      New Member
      • Dec 2007
      • 133

      #3
      Originally posted by debasisdas
      Before writing to the textbox u need to store the string already in the textbox. Append the second string to first and then display in textbox.
      Thats where i get confused when i store them then use them and say i press the same button twice it doesnt add to it

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        Originally posted by gobblegob
        Thats where i get confused when i store them then use them and say i press the same button twice it doesnt add to it
        which button you are pressing twice. 1st or the 2nd one.

        Comment

        • gobblegob
          New Member
          • Dec 2007
          • 133

          #5
          Originally posted by debasisdas
          which button you are pressing twice. 1st or the 2nd one.
          i want to be able to pess any button in any order any amount af times
          remember i only used 2 buttons as example i intent on using many buttons

          Comment

          • Ali Rizwan
            Banned
            Contributor
            • Aug 2007
            • 931

            #6
            Use this code:

            Code:
            Private Sub cmd1_Click()
            
            Text1.Text=Text1.Text & "First"
            
            End Sub
            
            Private Sub cmd2_Click()
            
            Text1.Text=Text1.Text & "Second"
            
            End Sub
            Regards
            >> ALI <<

            Comment

            • gobblegob
              New Member
              • Dec 2007
              • 133

              #7
              Originally posted by Ali Rizwan
              Use this code:

              Code:
              Private Sub cmd1_Click()
              
              Text1.Text=Text1.Text & "First"
              
              End Sub
              
              Private Sub cmd2_Click()
              
              Text1.Text=Text1.Text & "Second"
              
              End Sub
              Regards
              >> ALI <<

              Thankyou kind sir for your post its exactly what i need to know.
              Gobble.

              Comment

              • shuvo2k6
                New Member
                • Jan 2008
                • 68

                #8
                Hi all,
                Ali Rizwan is right, that is the right code.


                Regards,
                shuvo2k6

                Comment

                Working...