12 Ekim 2015 Pazartesi

AXAPTA - Add right click menu popup to form control

You can do this with overwrite control's showContextMenu method:

public int showContextMenu(int _menuHandle)
{
    int                 ret;
    int                bar1,bar2;
    PopupMenu           pMenu = PopupMenu::create(_menuHandle,element.hWnd());
    ;
        bar1 = pMenu.insertItem("Selection 1");
        bar2 = pMenu.insertItem("Selection 2");

    ret = pMenu.draw();
    switch (ret)
    {
    case -1 :
        break;
    case bar1:

...
    case bar2:
...
    default :
        break;
    }
    return ret;

}

Hiç yorum yok:

Yorum Gönder