usingSystem.Runtime.InteropServices;constuintTPM_LEFTBUTTON=0;constuintTPM_RIGHTBUTTON=2;constuintTPM_LEFTALIGN=0;constuintTPM_CENTERALIGN=4;constuintTPM_RIGHTALIGN=8;constuintTPM_TOPALIGN=0;constuintTPM_VCENTERALIGN=0x10;constuintTPM_BOTTOMALIGN=0x20;constuintTPM_RETURNCMD=0x100;constuintWM_SYSCOMMAND=0x0112;DllImport#regionDllImport[DllImport("User32.dll")]staticexternIntPtrGetSystemMenu(IntPtrhWnd,boolbRevert);[DllImport("User32.dll")]staticexternboolGetCursorPos(outPointlpPoint);[DllImport("User32.dll")]staticexternintTrackPopupMenu(IntPtrhMenu,uintuFlags,intx,inty,intnReserved,IntPtrhWnd,outRectangleprcRect);[DllImport("User32.DLL")]publicstaticexternintSendMessage(IntPtrhWnd,uintMsg,intwParam,intlParam);#endregionprivatevoidbutton1_Click(objectsender,EventArgse)...{PointvPoint;RectanglevRect;GetCursorPos(outvPoint);SendMessage(Handle,WM_SYSCOMMAND,TrackPopupMenu(GetSystemMenu(Handle,false),TPM_RETURNCMD|TPM_LEFTBUTTON,vPoint.X,vPoint.Y,0,Handle,outvRect),0);}