contextmenu

Retain DataGrid IsSelectionActive when a ContextMenu opens in WPF?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 08:36:10
问题 I have a DataGrid which has a style for IsSelectionActive ; however, as soon as the ContextMenu opens, the grid loses IsSelectionActive and it looks like to the user that as if the context menu somehow took the selection and may confuse the user. Is there a way to retain IsSelectionActive when a context menu opens? <ControlTemplate.Triggers> <MultiTrigger> <MultiTrigger.Conditions> <!--<Condition Property="Selector.IsFocused" Value="True" />--> <Condition Property="IsSelected" Value="True" />

Positioning Context Menu

我只是一个虾纸丫 提交于 2019-12-12 08:27:22
问题 I'm trying to position a custom context menu with jQuery. The first time it appears at the right position (mouse coordinates), but then the current position is being summed up with the new position, so that the menu disappears from the screen. Here is the JavaScript: <script> $(function(){ $('#box').hide(); $(document).bind("contextmenu", function(e) { $("#box").offset({left:e.pageX, top:e.pageY}); $('#box').show(); e.preventDefault(); }); $(document).bind("click", function(e) { $('#box')

Android add item to global context menu

最后都变了- 提交于 2019-12-12 07:17:59
问题 When you long press on something in Android, a context menu comes up. I want to add something to this context menu for all TextViews in the system. For example, the system does this with Copy and Paste. I would want to add my own, and have it appear in every application. 回答1: Currently Android does not support this, you cannot override or hook functionality globally at the system level without the particular activity implementing an intent or activity that you expose. Even in the case of

How can i add more commands to the shell file extensions?

六眼飞鱼酱① 提交于 2019-12-12 06:56:42
问题 What I am trying to do is adding two context menus, "Copy to Grayscale" and "List all images". I pass a parameter "List"/"Copy" to distinguish them. string menuCommand = string.Format("\"{0}\"{1}\" \"%L\" CopyGrayscaleImage", " List", Application.ExecutablePath); But this is wrong. What the menuCommand line should look like and how to handle it in the Main method ? This is the class FileShellExtensions using System; using System.Diagnostics; using Microsoft.Win32; namespace SimpleContextMenu

Change File Icon in windows using Java

十年热恋 提交于 2019-12-12 05:08:40
问题 Project Name: File Marker I personally organize my folders using "Folder Marker". It gives me option to change the folder icon from context menu (right-click menu). I can select planned work, half-done work, done work from contextmenu and my folder icon change according. Now I want to implement the same concept for individual files. I want to use Java to implement this solution in windows environment. Step 1: To add something in the context menu, the easiest way is to initiate a registry

VB.Net Get The Control That Is Used To Show The Contextmenu Strip

久未见 提交于 2019-12-12 05:07:30
问题 i am attaching a single context menu to multiple text box. so, i need to get the control name/reference that used to show the context menu. below is the sample image of my context menu: Below is the code for green marked "paste" item click event: Dim objTSMI As ToolStripMenuItem Dim objCMS As ContextMenuStrip Dim objTxtBox As System.Windows.Forms.TextBox objTSMI = CType(sender, ToolStripMenuItem) objCMS = CType(objTSMI.Owner, ContextMenuStrip) objTxtBox = CType(objCMS.SourceControl, System

Applying a custom header for ContextMenu

倖福魔咒の 提交于 2019-12-12 04:57:17
问题 I'm trying to apply a custom header to the ContextMenu of a ListView . Here's the code. @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); View header = View.inflate(getSherlockActivity(), R.id.context_menu_header, (ViewGroup) v); TextView title = (TextView) header .findViewById(R.id.context_menu_title); title.setText(cursor.getString(1)); menu.setHeaderView(header); android.view

WPF ContextMenu bound to 3 Listboxes on right-click

▼魔方 西西 提交于 2019-12-12 04:22:34
问题 I have three tabs and each has a listbox with different types of files. When I right-click on an item in the listbox, I want a ContextMenu with "New, Edit and Delete" as Item headers. I guess I could have a ContextMenu for each listbox, and then have a seperate method for each header, such as: <ListBox.ContextMenu> <ContextMenu x:Name="NewEditDeleteAdvCalcFileContextMenu"> <MenuItem Name="NewAdv" Header="New" Click="NewAdv_Click" /> <MenuItem Name="EditAdv" Header="Edit" Click="EditAdv_Click"

android delete file using context menu

老子叫甜甜 提交于 2019-12-12 04:04:38
问题 I've got a Listview showing files currently on the SDcard. When you long press the file, a context menu pops up. My question is: how do I pass in the selected item to the Context Menu in order to delete the file from the list, and is it possible to also delete it from the SDcard using this? My Code is as follows: public class PlayListActivity extends ListActivity { // Songs list public ArrayList<HashMap<String, String>> songsList = new ArrayList<HashMap<String, String>>(); @Override public

Detect a right-click on Ace editor

假装没事ソ 提交于 2019-12-12 03:58:38
问题 Is there a way to detect a right-click event on Ace editor? I've being trying to add a listener like this: editor.session.addEventListener('contextmenu', function(e) { e.preventDefault(); alert('success!'); return false; }, false); and this editor.addEventListener('contextmenu', function(e) { e.preventDefault(); alert('success!'); return false; }, false); but without success. Thanks! 回答1: add event listener on the element containing the editor editor.container.addEventListener("contextmenu",