如何使用 Visual Studio 扩展以编程方式调整代码编辑器窗口的大小? [英] How do I resize code editor window programmatically with a Visual Studio extension?

查看:34
本文介绍了如何使用 Visual Studio 扩展以编程方式调整代码编辑器窗口的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的很喜欢 Visual Studio Code 如何捕捉和调整拆分编辑器窗口的大小.由于我在它的大哥 Visual Studio 2017 中找不到类似的东西,我正在尝试编写一个简单的扩展来实现相同的结果.

I really like how Visual Studio Code snaps and resizes split editor windows. Since I couldn't find anything similar in its bigger brother Visual Studio 2017, I'm trying to write a simple extension to achieve the same result.

使用编辑器视图装饰"样板,我发现我可以以 IWpfTextView 的形式访问代码编辑器窗口;但是,这个接口没有提供任何定位和大小的setter.

Using the "Editor View Adornment" boilerplate I discovered that I can access the code editor window, in form of a IWpfTextView; however, this interface does not offer any setter for its positioning and size.

推荐答案

如果您的意思是像这样在 Visual Studio Code 中对齐和调整拆分编辑器窗口的大小:

If you mean snap and resize split editor windows in Visual Studio Code like this:

VS2017支持,点击Window\New Vertical Tab Group"选项:

It is supported by VS2017, click "Window\New Vertical Tab Group" option:

你会得到这样拆分的代码编辑器:

You'll get the code editor splited like this:

这篇关于如何使用 Visual Studio 扩展以编程方式调整代码编辑器窗口的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆