Tema: FAQ's de VB6
Ver Mensaje Individual
  #108 (permalink)  
Antiguo 07/10/2005, 17:34
Avatar de Jad-Neo
Jad-Neo
 
Fecha de Ingreso: octubre-2004
Mensajes: 344
Antigüedad: 19 años, 6 meses
Puntos: 0
Aportación: Como solucionar el problema del PopUpMenu de SmartMenuXP

Funciones para poder mostrar el PopUpMenu de los menus de SmartMenuXP, (ojo, los PopUpMenus de SmartMenuXP sólo se muestran si el control esta en Visible = False):

Código:
Function PosX(frm As Form, ByVal X As Single) As Integer
Dim nX As Integer, posX As Integer

nX = X / Screen.TwipsPerPixelX
posX = frm.Left / Screen.TwipsPerPixelX

PosX = (posX + nX) + 3
End Function

Function PosY(frm As Form, ByVal Y As Single) As Integer
Dim nY As Integer, posY As Integer

nY = Y / Screen.TwipsPerPixelY
posY = frm.Top / Screen.TwipsPerPixelY

PosY = (posY + nY) + 22
End Function
Ejemplo:
Código:
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 2 Then SmartMenuXP1.PopupMenu "mnuFile", PosX(Me, X), PosY(Me, Y)
End Sub
__________________
Nunca seas sabio en tu propia opinión.

Última edición por Jad-Neo; 18/10/2005 a las 17:19