Color Palette (VBA / Excel), right-click event for Frame objects

0

I could not find reference to the event that is triggered by the right mouse button in a Frame object. With the left mouse button event I select the desired color, this is working, but with the right button I would define the custom colors dynamically, but I could not find the desired event to do that.

The idea is to change the color background color to be customized (it works already) by clicking the right button on a Frame object. Each frame represents an additional color to customize (these are the sixteen blank areas at the bottom of the palette).

Is there an event corresponding to the right-click for the Frame object?

UPDATE

See the solution found in the Answer below

    
asked by anonymous 08.12.2015 / 19:53

1 answer

0

SOLUTION

I found the right mouse click control under a frame (works for other objects as well).

You should use the MouseDown or MouseUp event, for example (after creating Frame1 on the form):

Private Sub Frame1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)

If Button = 2 Then MsgBox "Botão direito do mouse"

End Sub

In this link the values corresponding to each mouse button appear, and the sum can be combined to know if more than one was triggered at the same time:

link

A detail, see the name of the parameters created within the event that is to be manipulated (look at the event arguments), as there are differences of what is informed in the site , since the description is for (fm) events, for example, the fmButton variable is indicated to capture the value of the mouse button pressed on a form, but in the event of the frame the variable is simply Button in>.

That's it!

    
14.12.2015 / 15:48