using button to control a label

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • khairulfnd
    New Member
    • Jun 2007
    • 9

    using button to control a label

    i have a label stored with a number(integer) and a button
    i'm trying to create a function which when the button is press the number increase by 1
    can someone help me with the codes
  • Hemant Pathak
    Recognized Expert New Member
    • Jul 2006
    • 92

    #2
    Originally posted by khairulfnd
    i have a label stored with a number(integer) and a button
    i'm trying to create a function which when the button is press the number increase by 1
    can someone help me with the codes
    Button Name=:Command1
    Lable Name = lbl1

    Private Sub Command1_Click( )
    lbl1.caption=va l( lbl1.caption)+1
    end sub

    Comment

    • ansumansahu
      New Member
      • Mar 2007
      • 149

      #3
      Originally posted by khairulfnd
      i have a label stored with a number(integer) and a button
      i'm trying to create a function which when the button is press the number increase by 1
      can someone help me with the codes
      Hi ,

      Try this code out.


      Dim i As Integer (declare this a global variable)

      Private Sub Command1_Click( )

      i = i + 1
      Label1.Caption = Val(Label1.Capt ion) + 1

      End Sub

      good luck
      -ansuman sahu
      www.mindfiresol utions.com

      Comment

      Working...