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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • carl2k2
    New Member
    • Mar 2008
    • 15

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

    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;

    Code:
    LBLxvat.Caption = (txtNoOfAdults.Text) + Val(txtNoOfChild.Text)
  • lee123
    Contributor
    • Feb 2007
    • 556

    #2
    you probably can use the (dblclick event)

    lee123

    Comment

    • carl2k2
      New Member
      • Mar 2008
      • 15

      #3
      Originally posted by lee123
      you probably can use the (dblclick event)

      lee123
      can u give me an example?

      Comment

      • gobblegob
        New Member
        • Dec 2007
        • 133

        #4
        Hi Carl,
        You could do it with a timer

        Code (VB 6)

        Code:
        Private Sub Timer1_Timer()
                If txtNoOfAdults.Text = "" Then
            Exit Sub
                Else
            LBLxvat.Caption = (txtNoOfAdults.Text) + Val(txtNoOfChild.Text)
            End If
        End Sub
        just set timer.enable = true and interval to something like 10

        GobbleGob.

        Comment

        • wireshark
          New Member
          • Mar 2008
          • 29

          #5
          Originally posted by carl2k2
          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;

          Code:
          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.

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            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?

            Comment

            Working...