简体   繁体   English

如何在Visual Studio编辑器中处理用户定义的页边距中的用户定义的字形?

[英]How to handle a User defined Glyph in a user defined Margin in the Visual Studio Editor?

I have an application which uses the Visual Studio shell, NowI extended the editor in my application with a margin in the left side. 我有一个使用Visual Studio Shell的应用程序,现在我在应用程序中扩展了编辑器,在左侧留有空白。 As Of now I am printing the number of characters in each line in the margin (In a label). 截至目前,我正在打印每行空白处的字符数(在标签中)。

The problem I am facing is that when I scroll down the editor the values I put in the margin is not coming up, I am sure that I put label for each line in the margin. 我面临的问题是,当我向下滚动编辑器时,放在空白处的值没有出现,我确定我将每行的标签放在空白处。

I want my margin to work like the breakpoint glyph in visual studio ? 我想让margin像Visual Studio中的断点字形一样工作吗? How to handle the scroll event in the editor or how to solve this issue ? 如何在编辑器中处理滚动事件或如何解决此问题?

I think you need to use a margin glyph instead of a label. 我认为您需要使用边距字形而不是标签。

You can use image functions to overlay the number or combine the number onto an icon. 您可以使用图像功能叠加数字或将数字组合到图标上。 (You could then cache the icons locally). (然后,您可以在本地缓存图标)。 If you follow the article it will handle scrolling for you, so you can let the framework do that. 如果您遵循本文,它将为您处理滚动,因此您可以让框架进行滚动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM