Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / April 2006

Tip: Looking for answers? Try searching our database.

Counterpart to Edit.LineTranspose?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert Schneider - 26 Apr 2006 08:57 GMT
Is there a counterpart to Alt+Shift+T which is Edit.LineTranspose? I guess
not, right?

But this imho is awkward. Like an indicator on a car but only for the left
side, not for the right?

If it doesn't exist could a macro do the same thing? If so could someone
kindly post a macro?

Cheers,
Robert

Signature

E-Mail: r._sch_nei_d_er#_we_ingar_t_ner.c_om
(remove each '_' from the address and replace '#' with '@')

Peter Macej - 26 Apr 2006 09:59 GMT
> Is there a counterpart to Alt+Shift+T which is Edit.LineTranspose? I guess
> not, right?

Isn't this "counterpart" just the same as Edit.LineTranspose applied to
the above line? I would just press ^ arrow and then Alt+Shift+T. Maybe
that's the reason why counterpart doesn't exist.

> If it doesn't exist could a macro do the same thing? If so could someone
> kindly post a macro?

Here it is:

Sub LineTransposeUp()
    Dim offset As Integer
    Dim sel As TextSelection

    DTE.UndoContext.Open("LineTransposeUp")
    Try
        sel = DTE.ActiveDocument.Selection
        offset = sel.ActivePoint.LineCharOffset
        sel.LineUp()
        DTE.ExecuteCommand("Edit.LineTranspose")
        sel.LineUp()
        sel.MoveToLineAndOffset(sel.ActivePoint.Line, offset)
    Catch ex As System.Exception
    End Try
    DTE.UndoContext.Close()
End Sub

Signature

Peter Macej
Helixoft - http://www.vbdocman.com
VBdocman - Automatic generator of technical documentation for VB, VB
.NET and ASP .NET code

Robert Schneider - 26 Apr 2006 13:22 GMT
Thanks, that works fine.

One further issue: Is there any way to avoid the balloon message that comes
up from the task bar? It's saying something about the abortion of the macro.

> Isn't this "counterpart" just the same as Edit.LineTranspose applied to
> the above line? I would just press ^ arrow and then Alt+Shift+T. Maybe
> that's the reason why counterpart doesn't exist.

One line is okay. But if you want to move it several lines than it's not
that nice anymore. I know, then I could do a copy and paste. But if there is
such an shortcut it is quite more fun. At least to me.

One further optimization would be to move not just one line rather whole
blocks of code.

Actually, this is not my idea. I've used this functionality in Eclipse. I
used it quite often. Now I miss it. You know, once you get used to it...

Signature

E-Mail: r._sch_nei_d_er#_we_ingar_t_ner.c_om
(remove each '_' from the address and replace '#' with '@')

>> Is there a counterpart to Alt+Shift+T which is Edit.LineTranspose? I
>> guess not, right?

>> If it doesn't exist could a macro do the same thing? If so could someone
>> kindly post a macro?
[quoted text clipped - 17 lines]
>     DTE.UndoContext.Close()
> End Sub
Robert Schneider - 27 Apr 2006 07:07 GMT
For those that are interested to get rid of the balloon tip, look into this
blog:
http://blogs.msdn.com/johnls/archive/2006/01/17/514004.aspx
and
http://blogs.msdn.com/craigskibo/archive/2004/06/29/169190.aspx

Signature

E-Mail: r._sch_nei_d_er#_we_ingar_t_ner.c_om
(remove each '_' from the address and replace '#' with '@')

> Thanks, that works fine.
>
[quoted text clipped - 40 lines]
>>     DTE.UndoContext.Close()
>> End Sub

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.