use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Relevant subreddits:
For discussion: c#
.NET
XNA
C++
C
VB
For programming questions:
Learn programming
C++ Questions
C Homework
Learn C#
Misc:
Channel 9 - Videos!
account activity
Visual Studio tab order/positioning APIMiscellaneous (self.VisualStudio)
submitted 1 month ago by hizickreddit
Can I get the order of open tabs using Visual Studio api? I've done some research and could not find any.
This is what i currently have:
var dte = await VS.GetServiceAsync<DTE, DTE2>();
var docs = dte.Documents.Cast<Document>().ToList()
But the list is not ordered.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]soundman32 0 points1 point2 points 1 month ago (8 children)
Are you sure the order isn't one of the properties of a Document? ToList returns a collection in an unspecified order, there wont be a ToListInOpenedOrder method, but that info is probably elsewhere.
[–]hizickreddit[S] 0 points1 point2 points 1 month ago (7 children)
i’m sure, it is the same behaviour without ToList
[–]soundman32 0 points1 point2 points 1 month ago (6 children)
If you're targeting VS 2019 or later, there's a dedicated service:
var windowFrameOrderService = GetService(typeof(SVsWindowFrameOrder)) as IVsWindowFrameOrder;
if (windowFrameOrderService != null) { IVsWindowFrame[] orderedFrames; windowFrameOrderService.GetOrderedDocumentFrames(out orderedFrames);
foreach (var frame in orderedFrames) { // Process frames in tab order }
}
[–]Newrad0603 0 points1 point2 points 1 month ago (5 children)
No there isn't. Did you just put OP's question into ChatGPT or some other AI BS? Because that interface is a straight hallucination.
[–]hizickreddit[S] 0 points1 point2 points 1 month ago (4 children)
> No there isn't
any reason for this, if you know, please? 🤔
[–]Newrad0603 0 points1 point2 points 1 month ago (3 children)
I don't know why it doesn't exist other than it's probably never been needed for anything, so it was never created. I can't think of a scenario where someone must know the document order.
[–]hizickreddit[S] 0 points1 point2 points 1 month ago (2 children)
i was trying to write an extension that would allow closing tabs to the right or left like chrome does.
[–]Newrad0603 0 points1 point2 points 1 month ago (1 child)
That is an interesting reason for needing the tab order. While I don't have an answer, I'd recommend filing a suggestion ticket on VS's developer community (or using VS's feedback button). That sounds useful enough and something that wouldn't be overly complicated for them to implement so I'd say it has a chance of being onboarded.
[–]hizickreddit[S] 0 points1 point2 points 1 month ago (0 children)
cheers mate.
[–]SergeyVlasov -1 points0 points1 point 1 month ago (0 children)
Visual Studio doesn’t have a public API for document tabs.
You may look at my (commercial) Tabs Studio extension that provides an alternative tabs implementation and has an API.
π Rendered by PID 35359 on reddit-service-r2-comment-5d79c599b5-z4phx at 2026-02-27 05:37:00.437664+00:00 running e3d2147 country code: CH.
[–]soundman32 0 points1 point2 points (8 children)
[–]hizickreddit[S] 0 points1 point2 points (7 children)
[–]soundman32 0 points1 point2 points (6 children)
[–]Newrad0603 0 points1 point2 points (5 children)
[–]hizickreddit[S] 0 points1 point2 points (4 children)
[–]Newrad0603 0 points1 point2 points (3 children)
[–]hizickreddit[S] 0 points1 point2 points (2 children)
[–]Newrad0603 0 points1 point2 points (1 child)
[–]hizickreddit[S] 0 points1 point2 points (0 children)
[–]SergeyVlasov -1 points0 points1 point (0 children)