Hi, Raymond -
Use the PopMenu PowerScript function.
I suggest you examine examples, such as the PFC framework or Chris Pollach's STD framework. I'm sure Chris will chime in to call out the object(s), events, functions in his framework. As for the PFC, the ancestor DW popup menu class is pfc_m_dw in the pfcmain.pbl. The DW's popup menu is displayed via the PopMenu PowerScript command in the RButtonUp event of the ancestor DataWindow control, pfc_u_dw, which also reside in the pfcmain.pbl.
You might also try search the Community Q&A for "right click" or "popup menu".
I hope this helps point you in the right direction.
Best regards, John
Thank you for the code. I used it and it worked great!