shortcut

Keyboard shortcut for a button

房东的猫 提交于 2019-11-29 11:22:05
问题 In C# (Microsoft Visual Studio 2010), how can I assign a keyboard shortcut to a button such as the following? private void closeButton_Click(object sender, EventArgs e) { // Close the program this.Close(); } I know I can use the "&" character in the button's Text and create an Alt - n shortcut, but I'd like to create a single keypress shortcut, such as c to execute the above. 回答1: KeyDown is your friend ;) For example, if you want the shortcut key A while Shift is pressed, try this: void

Run .jar through Windows shortcut passing arguments

北慕城南 提交于 2019-11-29 11:19:05
Is it possible run .jar through Windows shortcut (.lnk) passing arguments? Harry Johnston In Java 7, yes. You can point the shortcut to c:\windows\system32\java.exe or javaw.exe as appropriate and include the same arguments you would use on the command line. In a clean Java 8 installation, not easily. Unfortunately Java 8 no longer puts copies java.exe and javaw.exe into the system folder, but instead puts symbolic links in a ProgramData folder. Windows doesn't like shortcuts to symbolic links; sometimes they work, sometimes they don't. (Even the same shortcut might work for some user accounts

Can StyleCop automatically fix anything?

為{幸葍}努か 提交于 2019-11-29 10:56:12
问题 I've decided to start running StyleCop on a medium sized project and am getting over 1000 warnings. Is there a quick easy way to fix most of these warnings? Most of the warnings could easily have been automated to resolve and would save me a lot of time. 回答1: This doesn't exactly "automatically fix anything" but there is a StyleCop plug-in for Resharper on Codeplex that will automatically highlight the style errors in your code. Update: According to the StyleCop for ReSharper website,

Keyboard Shortcut “Takes 1 positional argument but 2 were given”

丶灬走出姿态 提交于 2019-11-29 08:52:51
Trying to make a keyboard shortcut to reset a game. Earlier in the __init__ class I create a menu to start a new game, and use self.reset to reset the score/grid etc. I now have been trying to implement the shortcut with the same command - the reset being a method within the class. self._master.bind_all('<Control-n>', self.reset) This is the error: TypeError: reset() takes 1 positional argument but 2 were given My confusion is that the self.reset works fine earlier in the __init__ but then does not work for the shortcut? I do not see how the shortcut is even giving any positional arguments to

How to create shortcut to Computer on the user's desktop

◇◆丶佛笑我妖孽 提交于 2019-11-29 08:17:41
I am working on a VBScript that is to show the "Computer" icon on the desktop. I've been able to do one for IE using the following code, however as Computer is a "Special Folder" that does not seem to have an actual location I can't use the same method. Would anyone have any idea how to enable it via VBScript? IE Shortcut code: Set objShell = WScript.CreateObject("WScript.Shell") 'Create Shortcut for IE on desktop allUsersDesktop = objShell.SpecialFolders("AllUsersDesktop") usersDesktop = objShell.SpecialFolders("Desktop") Set objShortCut = objShell.CreateShortcut(usersDesktop & "\Internet

How can I have a home screen shortcut launch a dialog?

久未见 提交于 2019-11-29 05:21:14
Okay, I asked another question here trying to make my activities look like dialogs. I'm thinking maybe instead of asking about a specific method, I should ask about what I'd like to do, and perhaps there is a different way to go about it... Here's what I have. My app allows shortcuts to be placed on the home screen. The code and logic for creating the shortcuts all works flawlessly, and the shortcuts then launch the proper activity which shows what it's supposed to... again, all works flawlessly. What I'm wondering though, is is there a way to have the home screen shortcut launch my activity

C# shortcut or shorthand getter setter

≯℡__Kan透↙ 提交于 2019-11-29 04:43:41
问题 Is there a short way to create the getter and setter in c#? public string fname {get; set;} Is there short hand to generate {get; set;} ? 回答1: yea type prop and press TAB. Visual Studio has a snippet for automatic property. For property with public get and private set, you can use propg and press TAB. For complete non auto property you can use propfull and press TAB. 回答2: If you just want the getter and setter, as orignally asked for, you could also create a custom snippet: <CodeSnippets

Creating a file shortcut (.lnk)

喜你入骨 提交于 2019-11-28 23:14:41
I have been looking for a simple way to create a shortcut to a file in C#, but I've only found external dlls that do that. It's actually quite surprising, there's no built in way to do that.. Anyway, I know that lnk files are just text files with a certain command and a given path. I thought that maybe I could create a text file (in the code) set it's text to the right command and change it's extension to .lnk I've tried to do that manually first, but failed to do so. Is there a way to do something like that (or maybe another simple way) to create a shortcut to a certain path in c#? Just to be

Close all tabs, but not the window, in Sublime Text

送分小仙女□ 提交于 2019-11-28 21:51:42
问题 Is there a way to close all tabs in one go in Sublime Text, but leave the window with the current project open? It is really annoying when I just want to close all open file and start the new task I have to Cmd-W them one by one. If I do Cmd-Opt-W it will close all tabs and the current project. 回答1: Thanks to Alex, it turned out kind of simple, Preferences > Key Bindings > User: { "keys": ["super+shift+w"], "command": "close_all" } No need to restart Sublime, it works right away. And what's

2D array values C++

两盒软妹~` 提交于 2019-11-28 21:06:33
I wanted to declare a 2D array and assign values to it, without running a for loop. I thought I could used the following idea int array[5] = {1,2,3,4,5}; Which works fine to initialize the 2D array as well. But apparently my compiler doesn't like this. /* 1 8 12 20 25 5 9 13 24 26 */ #include <iostream.h> int main() { int arr[2][5] = {0}; // This actually initializes everything to 0. arr [1] [] = {1,8,12,20,25}; // Line 11 arr [2] [] = {5,9,13,24,26}; return 0; } J:\CPP\Grid>bcc32.exe Grid.cpp Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland Grid.cpp: Error E2188 Grid.cpp 11: