By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,117 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,117 IT Pros & Developers. It's quick & easy.

adding to textbox

100+
P: 133
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.
Jan 29 '08 #1
Share this Question
Share on Google+
7 Replies


debasisdas
Expert 5K+
P: 8,127
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.
Jan 29 '08 #2

100+
P: 133
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
Jan 29 '08 #3

debasisdas
Expert 5K+
P: 8,127
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.
Jan 29 '08 #4

100+
P: 133
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
Jan 29 '08 #5

Ali Rizwan
100+
P: 927
Use this code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmd1_Click()
  2.  
  3. Text1.Text=Text1.Text & "First"
  4.  
  5. End Sub
  6.  
  7. Private Sub cmd2_Click()
  8.  
  9. Text1.Text=Text1.Text & "Second"
  10.  
  11. End Sub
Regards
>> ALI <<
Jan 29 '08 #6

100+
P: 133
Use this code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmd1_Click()
  2.  
  3. Text1.Text=Text1.Text & "First"
  4.  
  5. End Sub
  6.  
  7. Private Sub cmd2_Click()
  8.  
  9. Text1.Text=Text1.Text & "Second"
  10.  
  11. End Sub
Regards
>> ALI <<

Thankyou kind sir for your post its exactly what i need to know.
Gobble.
Jan 29 '08 #7

P: 68
Hi all,
Ali Rizwan is right, that is the right code.


Regards,
shuvo2k6
Jan 29 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.