示例#1
0
        protected override void OnBeforeContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams menuParams, CefMenuModel model)
        {
            model.InsertItemAt(model.Count > 0 ? 1 : 0, (int)CefMenuId.ReloadNocache, "Refresh");
            model.AddSeparator();
            model.AddItem(SHOW_DEV_TOOLS, "&Show DevTools");
            model.AddItem(INSPECT_ELEMENT, "Inspect element");


            CefMenuModel submenu = model.AddSubMenu(0, "Submenu Test");

            submenu.AddItem((int)CefMenuId.Copy, "Copy");
            submenu.AddItem((int)CefMenuId.Paste, "Paste");
            submenu.SetColorAt(submenu.Count - 1, CefMenuColorType.Text, CefColor.FromArgb(Colors.Blue.ToArgb()));
            submenu.AddCheckItem(0, "Checked Test");
            submenu.SetCheckedAt(submenu.Count - 1, true);
            submenu.AddRadioItem(0, "Radio Off", 0);
            submenu.AddRadioItem(0, "Radio On", 1);
            submenu.SetCheckedAt(submenu.Count - 1, true);
        }