Using contextmenu with listview in android

To get the item from the ListView item selected refer to ContextMenuInfo object (see last implemented method below). Full solution as follows: 1) register ListView for context menu in ListActivity class @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // … getListView().setAdapter(mAdapter); registerForContextMenu(getListView()); } 1a) if you have complex View on your list you might need … Read more

How add context menu item to Windows Explorer for folders [closed]

In the registration editor (regedit.exe) find: Context menu for right click on folders in left panel of Windows Explorer or on background of a directory in right panel: HKEY_CLASSES_ROOT\Directory\Background\shell if you are administrator HKEY_CURRENT_USER\Software\Classes\directory\Background\shell if you are a normal user Context menu for right click on folders in right panel of Windows Explorer: HKEY_CLASSES_ROOT\Directory\shell if … Read more

right click context menu for datagridview

You can use the CellMouseEnter and CellMouseLeave to track the row number that the mouse is currently hovering over. Then use a ContextMenu object to display you popup menu, customised for the current row. Here’s a quick and dirty example of what I mean… private void dataGridView1_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) … Read more

How to add a custom right-click menu to a webpage?

Answering your question – use contextmenu event, like below: if (document.addEventListener) { document.addEventListener(‘contextmenu’, function(e) { alert(“You’ve tried to open context menu”); //here you draw your own menu e.preventDefault(); }, false); } else { document.attachEvent(‘oncontextmenu’, function() { alert(“You’ve tried to open context menu”); window.event.returnValue = false; }); } <body> Lorem ipsum… </body> But you should ask … Read more