|
-
Sep 22nd, 2006, 10:23 AM
#1
Thread Starter
Frenzied Member
[resolved][C# 2.0] Annoying Event Handler Auto-Complete
When I add an event handler in Visual Studio 2005 and accept the auto-complete, the method stub looks like this:
Code:
this.MouseClick += new MouseEventHandler(Form1_MouseClick);
void Form1_MouseClick(object sender, MouseEventArgs e)
{
throw new Exception("The method or operation is not implemented.");
}
Is there a way to stop VS from adding the throw to the function body?
VS 2003 didn't do this. The method stub was blank.
Last edited by wey97; Sep 26th, 2006 at 07:31 AM.
-
Sep 22nd, 2006, 10:31 AM
#2
Re: [2.0] Annoying Event Handler Auto-Complete
It's there for you to delete when you implement it. Because you'd only subscribe to an event if you meant to implement it.
-
Sep 22nd, 2006, 10:34 AM
#3
Thread Starter
Frenzied Member
Re: [2.0] Annoying Event Handler Auto-Complete
 Originally Posted by mendhak
It's there for you to delete when you implement it. Because you'd only subscribe to an event if you meant to implement it.
Damn, mendhak, you should know me well enough to know I knew that.
I'm just lazy, and I've found it faster to comment out the line than going through the trouble of highlighting the whole line with my mouse and clearing it out. Then I end up with a bunch of trash comments all over the place.
There should at least be a keyboard shortcut for highlighting an entire line.
-
Sep 22nd, 2006, 10:46 AM
#4
Re: [2.0] Annoying Event Handler Auto-Complete
 Originally Posted by wey97
Damn, mendhak, you should know me well enough to know I knew that.
I'm just lazy, and I've found it faster to comment out the line than going through the trouble of highlighting the whole line with my mouse and clearing it out. Then I end up with a bunch of trash comments all over the place.
There should at least be a keyboard shortcut for highlighting an entire line.
With your cursor anywhere on the line you can "Ctrl+Delete" which will cut the entire line. Just make sure you didn't have anything in your clipboard that you wanted.
-
Sep 22nd, 2006, 10:50 AM
#5
Re: [2.0] Annoying Event Handler Auto-Complete
Sorry i meant "shift+delete"
-
Sep 22nd, 2006, 10:54 AM
#6
Thread Starter
Frenzied Member
Re: [2.0] Annoying Event Handler Auto-Complete
Nice tip. We need a "cool keyboard shortcuts" sticky.
-
Sep 22nd, 2006, 11:03 AM
#7
Re: [2.0] Annoying Event Handler Auto-Complete
-
Sep 22nd, 2006, 11:08 AM
#8
Thread Starter
Frenzied Member
Re: [2.0] Annoying Event Handler Auto-Complete
 Originally Posted by mendhak
My favorite is Ctrl+K,C.
I like that one.
My only complaint about that one or the comment selection toolbar button is it won't insert /* */ comments for a partial line selection like the c++ ide.
-
Sep 22nd, 2006, 11:09 AM
#9
Re: [2.0] Annoying Event Handler Auto-Complete
I like "Ctrl+M,O" and "Ctrl+M,P"
-
Sep 22nd, 2006, 06:25 PM
#10
Re: [2.0] Annoying Event Handler Auto-Complete
How about the fact that you can just click the mouse to the far left of the line to select the entire line? The space to do it is fairly small, particularly on lines that have an expansion button, but unless you have a medical problem that affects your fine motor skills it shouldn't be an issue. You'll know you're there because the mouse pointer will turn into a right-pointing arrow instead of a beam or left-pointing arrow.
-
Sep 25th, 2006, 07:32 AM
#11
Thread Starter
Frenzied Member
Re: [2.0] Annoying Event Handler Auto-Complete
 Originally Posted by jmcilhinney
How about the fact that you can just click the mouse to the far left of the line to select the entire line? The space to do it is fairly small, particularly on lines that have an expansion button, but unless you have a medical problem that affects your fine motor skills it shouldn't be an issue. You'll know you're there because the mouse pointer will turn into a right-pointing arrow instead of a beam or left-pointing arrow.
Good point but when you're already typing, it's a pain to have to switch to your mouse and back to typing again.
-
Sep 25th, 2006, 08:00 PM
#12
Fanatic Member
Re: [2.0] Annoying Event Handler Auto-Complete
How about just putting the cursor on the line and hitting crtl+x? It's the easiest key combination to hit and it cuts the entire line since there's no selection.
The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.
-
Sep 27th, 2006, 12:13 AM
#13
Re: [2.0] Annoying Event Handler Auto-Complete
 Originally Posted by DNA7433
How about just putting the cursor on the line and hitting crtl+x? It's the easiest key combination to hit and it cuts the entire line since there's no selection.
I just decided to experiment and Shift+Del has the same effect without overwriting the current contents of the clipboard, so it's marginally preferable I guess.
-
Sep 27th, 2006, 06:20 AM
#14
Banned
Re: [resolved][C# 2.0] Annoying Event Handler Auto-Complete
CTRL+E,D is a good one too. (vs 2005 that is, they changed a whole bunch of perfectly good combo's after 2003 for some reason. Also, CTLR+W, S is the solution exomprer and F4 is the properties panel. I often get rid of those 2 windows to give me more code writing space.)
-
Sep 27th, 2006, 07:11 AM
#15
Thread Starter
Frenzied Member
Re: [resolved][C# 2.0] Annoying Event Handler Auto-Complete
 Originally Posted by monoptic
CTRL+E,D is a good one too. (vs 2005 that is, they changed a whole bunch of perfectly good combo's after 2003 for some reason. Also, CTLR+W, S is the solution exomprer and F4 is the properties panel. I often get rid of those 2 windows to give me more code writing space.)
I use Auto Hide for Solution Explorer and Properties and get just as much space without having to remember a sequence of keys for showing.
-
Dec 4th, 2006, 04:11 PM
#16
Fanatic Member
Re: [2.0] Annoying Event Handler Auto-Complete
 Originally Posted by jmcilhinney
I just decided to experiment and Shift+Del has the same effect without overwriting the current contents of the clipboard, so it's marginally preferable I guess.
That's an odd one, how in the world did you even think to try that?
Does MS put out a list of all the shortcuts they have or are the rest of us supposed to stumble upon them?
Oh, and is there a way to make the dockable windows just appear instead of sliding on screen when you have them auto-hid? Even on my (somewhat) fast computer there's an annoying delay waiting for them to appear.
The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.
-
Dec 4th, 2006, 05:40 PM
#17
Re: [resolved][C# 2.0] Annoying Event Handler Auto-Complete
As I said, I just decided to experiment. The Delete key deletes things and Ctrl, Shift and Alt are modifier keys, so I decided to see how they modified the behaviour of the Delete key.
As for your last question, Tools -> Options -> Environment -> General -> Animate environment tools. The Options dialogue is the first place to look whenever you want to change the behaviour of the IDE. I didn't know about that setting myself but I just opened the Options dialogue and there it was.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|