VS2010 highlight references only on doubleclick - c#

Is it possible to make C# code editor in VS2010 only highlight word references when a word is doubleclicked, like e.g. MetalScroll, not always whenever the cursor is on a word?
Maybe there are some extensions that could do it? Is it even possible to affect this area of VS with an extension?

http://blogs.msdn.com/b/zainnab/archive/2010/04/14/the-best-of-visual-studio-2010-how-to-use-reference-highlighting.aspx
You could maybe use the information here to write a macro to enable/disable highlighting on demand (though it won't work on a double click)

Related

Visual Studio doesn't use saved Style Preferences

I have created my stylus preferences as shown in the screen
But when I go to click the button to format the code it formats it for me like this
Anyone know the reason?
As for how to modify whether the c# brackets wrap or not, you could modify the result you want in Tools->Options->C#->Code Style->Formationg->new lines.
By the way, what software are you using. Did your modification have any impact on your expectations?

How to Embedd notepad++ in my windows form?

Embed notepad++ in my windows form. Through which i want to control notepad++ with my own function.
I am using split container.
In panel1--i have a button.
In panel2--notepad++ appear when the form loading.
notepad++ appear on the panel2.
what i am expect is, i use one button in my form.
whenever i click that button, replacing will occur in notepad++ for a single word.
ex, text in notepad++ is,
"This is a file testing for replacing a word in notepad++ through Windows form."
i want to replace a word "This" to "It".
can anyone help me?
Expected Output appear in notepad++ is,
"It is a file testing for replacing a word in notepad++ through Windows form."
So far i did,
What you want to do can be achieved differently. Embedding Notepad++ is a wrong idea. It is an independent executable that is not intended to be the "plugin of something"... but is is a great plugin holder itself.
Check the Notepad++ documentation to create your own plugin,
which will probably be easier and more reliable.
If you want to stick with C#, use a dedicated Control to highlight
some synthax (if it is what you're trying to do), like Scintilla.NET.

Finding occurrences of a method or variable in Visual Studio

So I've been working with Visual Studio 2010 lately. While I'm not a huge fan of Eclipse, I do miss one feature: the fact that if you click on a function or variable in your code, it will mark all occurrences of that thing on the right frame of the text editor with a yellow or white rectangle. Does such a feature exist in Visual Studio? If not, is there a plugin out there that'll do this? I really don't want to resort to Find All every time I need to keep track where something is used.
Highlight References is feature in Visual Studio 2010 for C# and VB only. Any time you place the blinking caret on a symbol, Visual Studio will automatically highlight all instances of that symbol for you You can actually cycle through these highlighted references – just use Ctrl+Shift+up arrow and Ctrl+Shift+down arrow to move to the previous or next highlighted symbol.
The ProductivityPowerTools is what you may need. There you have a bar where you can see a minimized view of all your code. If you click there you can also navigate your code. But if you click within your actual code on a member, all occurences of this member are shown in the map.
Press Ctrl-K then Ctrl-R, this will find all references to the method (or object, variable, etc.)

Is there a way to highlight the currently active code block in Visual Studio 2010?

In Visual Studio 2010, if you hover your mouse over the little [-] minus sign, it will highlight that block of code for you. My question is, is there a way for this block to always be highlighted while you are coding inside of it? That way, as I'm hopping between methods and classes, whatever block I'm currently working on would be highlighted to help my eyes quickly focus.
Is there an option within Visual Studio for this? If not, are there any plugins that do this?
Resharper has some options for this, one will let you outline the braces you are currently in and I think the other lets you highlight the current line
ReSharper is nice, but if you're also looking for something for all kinds of languages, there is Visual Assist X, which also does nice highlighting.
It, too, has the option to highlight matching braces in your current block:
Then you have a line highlighter, either as a simple frame:
Or as a good looking background:
Sadly, there is no option in it to enable a real "block" highlighting like hovering over the [-] button does. :| I also looked for, but didn't find such an option within the Visual Studio options.
Highlight everything you want your eyes to focus on and press ctrl+H.
Or, highlight everything you DON"T want and right click "Outlining" then select "Hide Selection." The short cut for that is ctrl+M
This can be done using bookmarks. The out-of-the-box configuration of bookmarks does not highlight, however this can be changed easily:
Go to Tools – Options – Environment – Fonts and Colors. Under Display Items, select Bookmark. Now change the background color to something, like red. Then go to Tools – Options – Text Editor – General and uncheck Indicator Margin.
PS Bookmarks can be found in the Text Editor toolbar
PS2: To quickly set bookmarks use Ctrl+k+k, but beware of Ctrl+k+l which will wipe out all your bookmarks, it happened to me once!
Adapted from: http://blogs.msdn.com/b/saraford/archive/2007/09/05/did-you-know-how-to-change-a-bookmark-color.aspx

event name in sharpdevelop

i want to ask abt Sharpdevelop.
Can i change the control's event name in sharpdevelop ? I want to add "_" like in visual studio.
For Example, button click event in Sharp develop defaulted to Button1Click. can i change to Button1_Click like in visualstudio ?
Thanks.
Mike Webb's answer is the only way to generate an event handler method name with an underscore without modifying SharpDevelop's source code.
Lex Li's answer is also correct. There is no option in SharpDevelop to enable automatic generation of event handler method names that use an underscore. The only way currently is to modify the source code. It is a fairly straightforward code change.
Download the source for SharpDevelop.
Extract the code.
Locate the EventBindingService class (src\AddIns\DisplayBindings\FormsDesigner\Project\Src\Services\EventBindingService.cs)
Locate the CreateUniqueMethodName method.
Modify the single line of code in this method to use an underscore in the string format:
return String.Format("{0}_{1}", Char.ToUpper(component.Site.Name[0]) + component.Site.Name.Substring(1), e.DisplayName);
Build SharpDevelop from source code by running src\DebugBuild.bat or src\ReleaseBuild.bat
Then when you use your customised version of SharpDevelop and double click a button in the forms designer, for example, you will get an event handler with a name like "Button1_Click".
At some point in the future SharpDevelop 4 will allow this with an option that can be selected in Tools - Options.
Yes. If you go into design and look in the properties window for the control you will see a few icons at the top. One of these should give you the list of events (in VS it is a lightning bolt). In the left hand column are the linkable events and in the right hand column are the functions that are called when the events are triggered.
Simply rename the left hand field and make sure you have the function named correctly in code as well. You can also type a name into the left hand field and then double click inside it to generate the function automatically.
The underscore is evil to some people, like me :)
Well, if you do want the underscore, check out SharpDevelop source code and locate that part and modify it. It is open source, so you can do whatever you like to please yourself. I did not see a setting available somewhere, so modify the source code seems to be the only way to achieve your goal.
I know this is an old thread but in SharpDevelop v4.3 (v4.x - v5.x) there is a solution to this. In the past i've had to use the above method, however this one is much faster and easier.
Launch SharpDevelop and check the following setting:
Tools > Options > Windows Forms Designer > General > "Generate Visual Studio Style Event Handlers"

Categories