ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can I find a handle number of controls on Userform? (https://www.excelbanter.com/excel-programming/273436-how-can-i-find-handle-number-controls-userform.html)

sjoo

How can I find a handle number of controls on Userform?
 
Hello everyone,

I knew how to find a handle number of userform or application object.
as following:
------------------------------------------------------------------------------------------------
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Dim h As Long

h = FindWindow(vbNullString, Application.Caption)
If h = 0 Then
MsgBox "Sorry, I could not find that window"
Unload Me
Else
MsgBox "The Handle to that Window is: " & h
End If
------------------------------------------------------------------------------------------------
but I want to know how to find a handle number of an image control on the Userform.

How can I find a handle number of controls on the Userform?


Thanks in advance



Rob Bovey

How can I find a handle number of controls on Userform?
 

All of the MSForms ActiveX controls are windowless, so they don't have
window handles that you can acquire in this manner.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


"sjoo" wrote in message
...
Hello everyone,

I knew how to find a handle number of userform or application object.
as following:
----------------------------------------------------------------------------
--------------------
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Long

Dim h As Long

h = FindWindow(vbNullString, Application.Caption)
If h = 0 Then
MsgBox "Sorry, I could not find that window"
Unload Me
Else
MsgBox "The Handle to that Window is: " & h
End If
----------------------------------------------------------------------------
--------------------
but I want to know how to find a handle number of an image control on the
Userform.

How can I find a handle number of controls on the Userform?


Thanks in advance





All times are GMT +1. The time now is 03:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com