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

How to make it so i dont need to use a command button

P: 15
As part of my system, I wanted it so it would add values given in two text boxes together, i only know how to do this in the command button :)

Here is my code;

Expand|Select|Wrap|Line Numbers
  1. LBLxvat.Caption = (txtNoOfAdults.Text) + Val(txtNoOfChild.Text)
Mar 22 '08 #1
Share this Question
Share on Google+
5 Replies


lee123
100+
P: 556
you probably can use the (dblclick event)

lee123
Mar 22 '08 #2

P: 15
you probably can use the (dblclick event)

lee123
can u give me an example?
Mar 22 '08 #3

100+
P: 133
Hi Carl,
You could do it with a timer

Code (VB 6)

Expand|Select|Wrap|Line Numbers
  1. Private Sub Timer1_Timer()
  2.         If txtNoOfAdults.Text = "" Then
  3.     Exit Sub
  4.         Else
  5.     LBLxvat.Caption = (txtNoOfAdults.Text) + Val(txtNoOfChild.Text)
  6.     End If
  7. End Sub
just set timer.enable = true and interval to something like 10

GobbleGob.
Mar 23 '08 #4

P: 29
As part of my system, I wanted it so it would add values given in two text boxes together, i only know how to do this in the command button :)

Here is my code;

Expand|Select|Wrap|Line Numbers
  1. LBLxvat.Caption = (txtNoOfAdults.Text) + Val(txtNoOfChild.Text)
sorry...what event,you want that caption will add? after insert 'txtNoOfChild'? or what? if that so,you can use keypressed event in your text box.
Mar 23 '08 #5

Expert 5K+
P: 8,434
Yes, Carl I think you need to explain to us what it is you do want to happen. You just said you don't want to use a command button.

By the way, what version of VB are you using?
Mar 25 '08 #6

Post your reply

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