I just write the following code in the Treeview_MouseDown event:
When my form in Maximized mode, everything is fine, PopUpmenu just beside my mouse pointer. But if I resize my form then the problem come out and I can not set the PopUpmenu right beside my mouse pointer.Code:Dim Px As Long Dim Py As Long If Button = vbRightButton Then GetCursorPos pt Px = ScaleX(pt.x, vbPixels, vbTwips) Py = ScaleY(pt.y, vbPixels, vbTwips) - 250 PopupMenu mnuOPTION, vbPopupMenuLeftAlign, Px, Py End If
It is something wrong with my code? Does anyone have a better solution for the PopUpMenu?
Thanks,
Chris.C




Reply With Quote