right-click

Show the default right-click menu - Delphi

末鹿安然 提交于 2019-11-30 07:16:45
I have a Listbox which contain a list of files . can i access the Windows right-click menu in the listbox to access the open , properties , delete and rename items ? Kermia check the JclShell unit from the JEDI JCL library, inside of this unit exist a function called DisplayContextMenu which show the context menu associated to a file. this function encapsulate the calls to the IContextMenu interface and makes your work more easy. function DisplayContextMenu(const Handle: HWND; const FileName: string; Pos: TPoint): Boolean; Check the IContextMenu interface. But be aware that Windows shell doesn

How to disable mouse right click on a web page? [duplicate]

廉价感情. 提交于 2019-11-30 04:49:33
This question already has an answer here: How do I disable right click on my web page? 23 answers I want to disable mouse right click on an HTML page. I have a page where user has to enter the details. I don't want the user to see the menu thats get displayed with the mouse right click. Rather I want to display a custom menu. I know there are some plugins available to do that. But my requirement does not need any plugins. It's unprofessional, anyway this will work with javascript enabled: document.oncontextmenu = document.body.oncontextmenu = function() {return false;} You may also want to

Unable to detect right mouseclick in ComboBox

冷暖自知 提交于 2019-11-29 20:48:58
问题 I have a ComboBox that is a simple drop down style. I wanted to open a new window when the user right clicks on an item in the list, but am having trouble getting it to detect a right click has occurred. My code: private void cmbCardList_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right && cmbCardList.SelectedIndex != -1) { frmViewCard vc = new frmViewCard(); vc.updateCardDisplay(cmbCardList.SelectedItem); vc.Show(); } } If I change e.Button == MouseButtons.Left

how can you do right click using selenium?

混江龙づ霸主 提交于 2019-11-29 17:32:16
问题 im trying to preform a right click using selenium, any thoughts on how to do this? 回答1: Please see docroots's answer for selenium. To generally simulate a right click in JavaScript, have a look at JavaScript simulate right click through code. 回答2: According to the OpenQA.Selenium.Interactions Namespace. // step 1 - select the element you want to right-click var elementToRightClick = this.Driver.FindElement(By.Id("elementtoclickonhasthisid")); // step 2 - create and step up an Actions object

How to generate a right-click event in all browsers

谁都会走 提交于 2019-11-29 08:05:25
A little context: The app I'm working on has a right-click context menu for certain objects on the screen. The current design as that each of these objects listens for a right-click, sends an AJAX request to get the context data for that object, uses that data to create a PopupMenu2 from Dojo 0.4.3 (I know!), and then generates a right-click to launch the Dojo menu. I'm trying to figure out a way to generate a right-click event for all browsers. Currently, we only support IE and use the oncontextmenu event. Restrictions: No jQuery :( I cannot pre-load all the data for the objects on screen to

Detecting a context-menu paste in the browser with jquery

☆樱花仙子☆ 提交于 2019-11-29 04:39:29
I am trying to check the length of the text in a textarea when someone pastes content in there via the right-click but can't seem to find how to do it. $('textarea').bind('paste', function() { var that = this; setTimeout(function() { var length = that.value.length; alert(length); }, 0); }); Live demo: http://jsfiddle.net/4UrE3/1/ Works in Firefox 3.6, Chrome, Safari and IE9 beta. Does not work in Opera. 来源: https://stackoverflow.com/questions/4702814/detecting-a-context-menu-paste-in-the-browser-with-jquery

How to disable mouse right click on a web page? [duplicate]

爷,独闯天下 提交于 2019-11-29 02:11:06
问题 This question already has an answer here: How do I disable right click on my web page? 23 answers I want to disable mouse right click on an HTML page. I have a page where user has to enter the details. I don't want the user to see the menu thats get displayed with the mouse right click. Rather I want to display a custom menu. I know there are some plugins available to do that. But my requirement does not need any plugins. 回答1: It's unprofessional, anyway this will work with javascript enabled

JS: detect right click without jQuery (inline)

时光怂恿深爱的人放手 提交于 2019-11-28 22:03:52
I'm calling a function, that builds a table which includes several links. I want to check if a link has been clicked with right or left mouse. I tried to add the following part to the <a> hyperlink. onmousedown="function mouseDown(e){ switch (e.which) { case 1: alert('left'); break; case 2: alert('middle'); break; case 3: alert('right'); break; } }" But nothing happens If I click on a link. xdazz The html: <a href="#" onmousedown="mouseDown(event);">aaa</a>​​​​​​​​​​​​​​​​​​​​​​​​​​​ The javascript: function mouseDown(e) { e = e || window.event; switch (e.which) { case 1: alert('left'); break;

Adding a right click menu to an item

空扰寡人 提交于 2019-11-28 21:03:13
I have been searching for a while for a simple right-click menu for a single item. For example if I right-click on a picture I want a little menu to come up with my own labels: Add, Remove etc. If anyone could help I would be most greatful. Thanks for looking. Here is the completed code: ContextMenu cm = new ContextMenu(); cm.MenuItems.Add("Item 1", new EventHandler(Removepicture_Click)); cm.MenuItems.Add("Item 2", new EventHandler(Addpicture_Click)); pictureBox1.ContextMenu = cm; Yuki Kutsuya Add a contextmenu to your form and then assign it in the control's properties under ContextMenuStrip.

Adding a right-click menu for specific items in QTreeView

本小妞迷上赌 提交于 2019-11-28 17:30:28
I'm writing a Qt desktop application in c++ with Qt Creator. I declared in my main window a treeView, and a compatible model. Now, I would like to have a right-click menu for the tree item. Not for all of the items, but for a part of them, for example: for the tree elements with an even index. I tried adding a simple context menu with the following code: in the .h file: QStandardItemModel* model; QMenu* contextMenu; QAction* uninstallAction; private slots: void uninstallAppletClickedSlot(); and in the .cpp file: in the constructor: ui->treeView->setModel(model); contextMenu = new QMenu(ui-