In the VS6 it was optional "extra feature".
Then, apparently, someone decided that it is "the only right thing" for VS.
NET 2003. Well, I and everyone I work with hates it...
It seems to be the same in VS.NET 2005.
There is an option "Apply Cut or Copy commands to blank lines when there is
no selection", but it doesn't turn it off completely and just makes its
behaviour even more confusing.
Is there a way to get rid of this "feature"?
Thanks.
Hi Serge,
AFAIK, there is no direct way, but you can create a macro or add-in like
this (not tested and not optimized) to intercept the Edit.Copy command and
cancel it if there is no selection:
Private Sub CommandEvents_BeforeExecute(ByVal Guid As String, ByVal ID As
Integer, ByVal CustomIn As Object, _
ByVal CustomOut As Object, ByRef CancelDefault As Boolean) _
Handles CommandEvents.BeforeExecute
Dim objCommand As Command
Dim objTextDocument As TextDocument
objCommand = DTE.Commands.Item(Guid, ID)
If objCommand.Name = "Edit.Copy" Then
Try
objTextDocument = Ctype( DTE.ActiveWindow.Document.Object,
EnvDTE.TextDocument
If
objTextDocument.Selection.TopPoint.EqualTo(objTextDocument.Selection.BottomPoint)
Then
CancelDefault = True
End If
Catch ex As System.Exception
End Try
End If
End Sub

Signature
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
> In the VS6 it was optional "extra feature".
> Then, apparently, someone decided that it is "the only right thing" for
[quoted text clipped - 7 lines]
> Is there a way to get rid of this "feature"?
> Thanks.
SergeK - 11 Mar 2006 03:39 GMT
Thanks, I'll give it a try.