ContextMenu SubMenu Position

Helo I have a button with a ContextMenu all the way on the topright of my window.I would like to have submenus on the contextmenu which is self explanitory the only problem is the submenus expand right and open beyond the screen.I dug through alot of the contextmenu class files and it seems that theres nothing in there to change which way the submenus expand any advice?