Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8490463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:07:39+00:00 2026-06-10T22:07:39+00:00

I have two labels on a form lab01_Click: lab02.Caption = lab02.Caption + 1 Is

  • 0

I have two labels on a form

lab01_Click:
lab02.Caption = lab02.Caption + 1

Is there a way to use lab01 as a spin button ?
If I keep pressing it – then lab02.Caption should keep changing continously ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:07:40+00:00Added an answer on June 10, 2026 at 10:07 pm

    You can store data in the Tag property also

    eg

    Private Sub Label1_Click()
    If Label1.Tag = "" Then Label1.Tag = 0
     Label1.Tag = CLng(Label1.Tag) + 1
     Label1.Caption = "Increment: " & Label1.Tag
    End Sub
    
    Private Sub Label2_Click()
    If Label1.Tag = "" Then Label1.Tag = 0
     Label1.Tag = CLng(Label1.Tag) - 1
     Label1.Caption = "Increment: " & Label1.Tag
    End Sub
    

    Update: Ok I see you want to keep it incrementing if click is depressed. The only way I can think is a nasty ‘hack’ which re-triggers a timer event.
    You will need to update object names Userform1 , Label1 and Label2 and may need to adjust Private Declare Function to Private Declare PtrSafe Function for 64bit

    Try this in a MODULE

    Option Explicit
    
    Private Declare Function SetTimer Lib "user32" _
    (ByVal hWnd As Long, _
    ByVal nIDEvent As Long, _
    ByVal uElapse As Long, _
    ByVal lpTimerFunc As Long) As Long
    
    Private Declare Function KillTimer Lib "user32" _
    (ByVal hWnd As Long, _
    ByVal nIDEvent As Long) As Long
    
    Private m_TimerID As Long
    
     'Note:  The duration is measured in milliseconds.
     '         1,000 milliseconds = 1 second
    Public Sub StartTimer(ByVal Duration As Long)
         'If the timer isn't already running, start it.
        If m_TimerID = 0 Then
            If Duration > 0 Then
                m_TimerID = SetTimer(0, 0, Duration, AddressOf TimerEvent)
                If m_TimerID = 0 Then
                    MsgBox "Timer initialization failed!"
                End If
            Else
                MsgBox "The duration must be greater than zero."
            End If
        Else
            MsgBox "Timer already started."
        End If
    End Sub
    
    Public Sub StopTimer()
         'If the timer is already running, shut it off.
        If m_TimerID <> 0 Then
            KillTimer 0, m_TimerID
            m_TimerID = 0
        Else
            MsgBox "Timer is not active."
        End If
    End Sub
    
    Public Property Get TimerIsActive() As Boolean
         'A non-zero timer ID indicates that it's turned on.
        TimerIsActive = (m_TimerID <> 0)
    End Property
    
    Private Sub TimerEvent()
        If UserForm1.Label2.Tag = "" Then UserForm1.Label2.Tag = 0
        UserForm1.Label2.Tag = CLng(UserForm1.Label2.Tag) + 1
        UserForm1.Label2.Caption = "Increment : " & UserForm1.Label2.Tag
    End Sub
    

    and this in the USERFORM

    Option Explicit
    
    Private Sub Label1_MouseDown(ByVal Button As Integer, _
        ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
        StartTimer 200 'millisecond update
    End Sub
    
    Private Sub Label1_MouseUp(ByVal Button As Integer, _
        ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
        StopTimer
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to do a user registration form (classical layout with two columns, labels
I have two sections in a form, and I have a button that toggles
I have two labels on a form. I want to be able to drag
I have a form on which there are three labels, whose values change when
I have a button and two labels in my aspx page , i would
I have two labels (A and B) in a Flex VBox, with the horizontal
I have two labels that are stacked. If I want a horizontal line between
For Android I have two labels in a table row. I am trying to
I've created a skin that allows me to have two labels on a spark
I have a view which has two labels. When I swipe left I fill

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.