How to remove unused Clicked event from C# project - c#-3.0

I am newbie in C#. while working in Windows Forms Designer if any controls get double-clicked by mistake it places the clicked event on the Form.cs (ie: private void UserAddBtn_Click(object sender, EventArgs e). how can I remove all the references of this event while staying in Forms designer or w/o going thru manual removal.
Thanks in advance....

You can clear the event handler by deleting it from the properties dialog.
Go to the events tab and find the double click event. You can then delete the event handler from there.

if you select the item you want to remove in the form designer, then right click on the lightning bolt and click "reset" it works for me. I couldn't make it work as explained above. I'm using Visual studio express 2013 V12 - Update 4.

In the designer view, click undo (Ctrl + Z) - this will undo the generated event handler in the code-behind as well as all bindings to the event handler in the .designer.cs autogenerated. Do not perform the undo in the event handler codebehind, because this will remove the event handler, but leave the bindings to it.
NOTE: If you add any code to the event handler, then undo will only remove the bindings - the event handler will get left behind. This is to make sure you don't lose anything you added that might be important.

I am privy to doing this myself lol. However, it is quite simple (I am using Visual Studio 2017). Delete the unused event and try to run while not debugging. Select no and look at the bottom where it lists the errors. Double click the red "X". Visual Studio will direct you to the next error. Delete that and you should be good to go (Should be a .Click event handler). Whether this works in all scenarios this simply I am not sure but if you have no code in that block then there should not be too much more complexity.

Go to the event handler -> Find All References -> go to the reference and delete it. Then delete the event handler.

Related

Elsa workflow designer drag and drop not work

I have a problem with the drag & drop when I use the designer.
I tried to add a "Fork-Join" but I can't connect the Branches with the Join.
When I try to drag them, it moves the whole workflow.
What am I doing wrong?
From the documentation:
To connect an outcome to an existing activity:
Press and hold the SHIFT button while left-clicking the outcome from which you wish to connect.
Left-click on the target activity (no need to keep pressing SHIFT)
If that doesn't work, then it must be a bug. In which case I would encourage you to file a bug.

how to know what are the lines covered in the code for a particular point of execution in eclipse

How to know what are the lines of code covered in the java class for a particular point of execution in eclipse. For example,if button click event is fired then how to know what are the lines of code is being executed during this event. Any plugins in eclipse or any free software for this to track the code ?
Go to the following page, it will instruct you through the process. The only thing you need to do is prepare a j-unit test for your code (for the method that gets called when pressing the button).
http://crunchify.com/what-is-the-best-code-coverage-plugin-you-should-use-in-eclipse-ide/

Is it possible to access mouse events in a Visual Studio Code extension

I would like to write a simple extension for Visual Studio Code to allow basic drag and drop copy/paste functionality but I can't find any way to be notified of mouse events. Have I overlooked something obvious or has the editor intentionally been designed to be keyboard only (well mostly)?
Note: I am referring to the TypeScript based Visual Studio Code editor not the full-blown Visual Studio.
EDIT: I should have phrased the question differently because there is indeed drag and drop copy/paste now, but it's still not clear to me how to handle mouse events in an extension.
No.
There are currently (2021) no API features that allow for hooking into drag and drop mouse events.
In general, if you want to let an extension hook into things happening in VS Code you can do so by subscribing to certain events (search for "events" on that page).

Can't make a method static in ReSharper because menus are greyed out

I'm trying to follow some steps to move methods from one class to another class with ReSharper 7.1.1. One of the steps to do this involves making the method static, however, the context menu entry Make Method Static... seems to be disabled and greyed out. The strange thing is it wasn't greyed out before on the same function, but after I discarded my changes to do it again, it seems to be greyed out now.
I've tried highlighting the function name and the whole function itself to try to make the menu entry active, but still no luck. How can I enable the Make Method Static... menu again?
Please check that your method is not virtual and is not used to implement an interface. Otherwise, please provide a code sample.

swt: slectionChanged is fired upon combo box expansion

This happens only on Linux. I have a ComboViewer where some elements trigger a dialog to appear. What happens (I debugged this) is when combo box is expanded ISelectionChangedListener.selectionChanged is fired. This causes first element of the viewer to be selected and dialog launched. This occurs in a two page wizard, so once this happens and I go to previous page and then come back to the one with the viewer I don't see selectionChanged firing upon combo box expansion.
On Windows I don't see this problem - selectionChanged only occurs when element is explicitly selected from the combo box.
Does anybody know if this is a known problem and is there fix for it? I understand that my case is somewhat unique.
thanks,
Alex
Sounds like a bug to me. I understand you can search the Eclipse bug database, this might be a repeat.