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

  • SEARCH
  • Home
  • 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 6583205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:22:43+00:00 2026-05-25T16:22:43+00:00

I want to detect when there’s a mouse_down on any Frame on the Form

  • 0

I want to detect when there’s a mouse_down on any Frame on the Form while the mouse is still down. I know how to do it for a Click, but I want to catch it before mouse_up.

Thanks

  • 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-05-25T16:22:43+00:00Added an answer on May 25, 2026 at 4:22 pm

    You can create a _MouseDown event handler for each frame on the form, or if you have many frames you can create a generic event handler class

    Create a Class module (eg named cUserFormEvents)

    Public WithEvents Frme As MSForms.frame
    Public frm As UserForm
    
    Private Sub Frme_MouseDown( _
     ByVal Button As Integer, _
     ByVal Shift As Integer, _
     ByVal X As Single, _
     ByVal Y As Single)
    
        ' Put your event code here
        MsgBox Frme.Caption
    
    End Sub
    

    Declare a collection for your Frames

    Dim mcolFrames As New Collection
    

    Include this code in your form initialistion

    Private Sub UserForm_Initialize()
        Dim ctl As MSForms.Control
        Dim clsEvents As cUserFormEvents
    
        'Loop through all controls on userform
        For Each ctl In Me.Controls
            'Only process Frames
            If TypeOf ctl Is MSForms.frame Then
                'Instantiate class module and assign properties
                Set clsEvents = New cUserFormEvents
                Set clsEvents.Frme = ctl
                Set clsEvents.frm = Me
    
                'Add instance to collection
                mcolFrames.Add clsEvents
    
            End If
    
        Next ctl
    
    End Sub
    

    Now, Frme_MouseDown will execute on MouseDown on any Frame on the form. Access the specific Frame with Frme

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to detect processors fan speed is there any Java library to do
I want to detect if there are memory leaks in my application. But the
I want to detect middle mouse clicks on a QTabWidget. I was expecting there
my app accesses the internet and i just want to detect whether there is
Is there anyway, in PHP, to detect someone's username? I want to track the
I have this problem. I want to detect if there is not a session
I want to detect when my application is sent to the background. There are
In short, I want to detect a touch on the navigation controller titlebar, but
Is there any way to detect what orientation a phone was in when an
Is there any way i can detect for how long a button is press??

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.