shortcuts

Binding a WPF ShortCut Key to a Command in the ViewModel

牧云@^-^@ 提交于 2019-11-27 07:33:59
I have a WPF app that is using the MVVM pattern. Hooking up buttons to the VM is pretty straight forward since they implement the ICommand. I have a context menu that works similar. The next step is to create shortcut keys for the context menu. I can't figure out how to get the shortcut key invoke the Command. Here is an example: <MenuItem Header="Update" Command="{Binding btnUpdate}" > <MenuItem.Icon> <Image Source="/Images/Update.png" Width="16" Height="16" /> </MenuItem.Icon> </MenuItem> now I've added this: <Window.InputBindings> <KeyBinding Key="U" Modifiers="Control" Command="{Binding

Visual Studio 2005 Shortcuts

寵の児 提交于 2019-11-27 06:57:01
问题 I'm trying to bind the following shortcut: Ctrl + W to close tabs How can you customize VS to add/change shortcuts? Also, what are the most useful shortcuts you guys have found? 回答1: Tools > Options > (Show all settings), then Environment > Keyboard. Here, rebind the key “File.Close” to Ctrl + W . 回答2: VS 2005/2008 Keybinding posters: Visual C# 2008 Keybinding Reference Poster Visual C# 2005 Keyboard Shortcut Reference Poster Visual Basic 2008 Keybinding Reference Poster Visual Basic 2005

Run a Command Prompt command from Desktop Shortcut

孤人 提交于 2019-11-27 06:06:29
Is it possible to create a desktop shortcut that, when pressed, will open command prompt and run a pre-defined command? Robin Hood Create A Shortcut That Opens The Command Prompt & Runs A Command: Yes! You can create a shortcut to cmd.exe with a command specified after it. Alternatively you could create a batch script, if your goal is just to have a clickable way to run commands. Steps: Right click on some empty space in Explorer, and in the context menu go to "New/Shortcut". When prompted to enter a location put either: " C:\Windows\System32\cmd.exe /k your-command " This will run the command

Editing shortcut (.lnk) properties with Powershell

守給你的承諾、 提交于 2019-11-27 04:36:54
I've found a nasty VBS way to do this, but I'm looking for a native PoSh procedure to edit the properties of a .LNK file. The goal is to reach out to remote machines, duplicate an existing shortcut with most of the correct properties, and edit a couple of them. If it would just be easier to write a new shortcut file, that would work too. Copy-Item $sourcepath $destination ## Get the lnk we want to use as a template $shell = New-Object -COM WScript.Shell $shortcut = $shell.CreateShortcut($destination) ## Open the lnk $shortcut.TargetPath = "C:\path\to\new\exe.exe" ## Make changes $shortcut

Modify Windows shortcuts using Python

荒凉一梦 提交于 2019-11-27 02:58:29
问题 How do you change a Windows shortcut using Python? e.g. from: H:\My Music\some_file.mp3 to: D:\Users\Myself\My Music\some_file.mp3 回答1: Here's another, more appropriate way to do this in Python with Winshell library: Using Python to create Windows shortcuts. In your case the code will look like: import os, winshell from win32com.client import Dispatch desktop = winshell.desktop() path = os.path.join(desktop, "some_file.mp3.lnk") target = r"D:\Users\Myself\My Music\some_file.mp3" wDir = r"D:

How to disable zoom on Ctrl+scroll in Visual Studio 2010?

☆樱花仙子☆ 提交于 2019-11-27 00:31:54
问题 Visual Studio 2010 adds a zoom setting on the bottom left of the text editor (to the left of the horizontal scroll bar) and also adopts the Ctrl +mouse scroll idiom for zooming in and out. The former is fine, but I dislike the latter as I am occasionally still holding control when I start scrolling my source code (which results in the text size radically changing and completely throwing me off whatever I was doing). How do I disable it? 回答1: Go to Tools->Extension manager, and search the

Customizable Shortcuts in Java Application

被刻印的时光 ゝ 提交于 2019-11-26 23:07:39
I would like to include customizable keyboard shortcuts in my Java application (the user can change them). Since this is not very unusual request, I was wondering if there exists a library/project that could help me achieve my goal. Unfortunately I was not able to find anything useful on Google. Thank you, aZen Ended up building my own shortcut manager from scratch. This took around 20h. trashgod Shortcuts may be specified as accelerators in instances of Action . Less flexibly, shortcuts may be represented by KeyEvent instances obtained via KeyListener . Either may be stored in java.util

How to send keyboard shortcut ALT SHIFT z (hotkey) with Selenium2?

风流意气都作罢 提交于 2019-11-26 22:59:57
问题 I am trying send shortcut with Actions.sendKeys, but it isn't work. (New Actions(driver)).SendKeys(Keys.ALT, Keys.SHIFT, "z"); 回答1: You can check this question to refer about this - Key press in (Ctrl+A) Selenium WebDriver Check the answer which uses the chord method , in your case you can do this - String selectAll = Keys.chord(Keys.ALT, Keys.SHIFT,"z"); driver.findElement(By.tagName("html")).sendKeys(selectAll); 回答2: This can also be done using Actions keyUp and keyDown funcitons. WebDriver

How do you create an application shortcut (.lnk file) in C# with command line arguments

▼魔方 西西 提交于 2019-11-26 21:26:38
问题 I've written a simple FTP based file synchronization program. The settings of which can be stored in an XML file. I want users to be able to quickly open the program using various configurations. So I set up the program to be able to read the path to a config file through command line argument. This way shortcuts can be created on the desktop based on different config files. Now I'm trying to add a feature that will automatically create the shortcut for a specific config file. I've tried

Can I set an environment variable for an application using a shortcut in Windows?

99封情书 提交于 2019-11-26 18:06:50
问题 I have a feeling I should be able add a directory to the PATH environment variable on an application-lifetime basis, but I can't find out how to do this. Is it possible to add a parameter to a Windows shortcut that appends a directory to the current value of PATH for use by the application being linked? 回答1: Let the shortcut execute a batch file (.cmd), that Sets the environment variable execute the app You use "START" to execute the app, this will start the app in another process, but it