How can I detect whether the Icon is clicked?

There is a Icon on a Button.
I need to check if the Icon is clicked or not, then process further logic.
From Button’s event handler, I don’t see Icon click event.

How can I detect whether the Icon is clicked?

A little more info would be helpful. Is the question, did the user click the icon vs. did he click some other part of the button? Or is the question, is the Action event because the user clicked, or is it because the button was activated in code?

Use a Beavel button. Make two properties ButtonX and ButtonY as integer.

MouseMove Event:
Sub MouseMove(X As Integer, Y As Integer)
ButtonX = X
ButtonY = Y
End Sub

MouseDown Event:
// Area for 16 x 16 px icon
// Left me.IconDX
// Right = Left + 16
// Top = (me.Height - 16) / 2
// Bottom = Top + 16
// Icon name = changes16

dim IconLeft as integer
dim IconTop as integer
dim IconRight as integer
dim IconBottom as integer

IconLeft = me.IconDX
IconTop = (me.Height - changes16.Height) / 2
IconRight = IconLeft + changes16.Width
IconBottom = IconTop + changes16.Height

if ButtonX >= IconLeft and ButtonX <= IconRight and ButtonY >= IconTop and ButtonY <= IconBottom then
msgbox “Icon was clicked”
end if

This is really what I wanted to know. I will try that.

Thank you!

Perfect. It really works well.
Thank you.