c# - 如何使用 ICsharpCode.TextEditor 组件自动完成标签?
问题描述
我已将ICSharpCode.TextEditor.dll组件添加到我的 C# 项目中的 Visual Studio 2017 参考中。接下来,我想找到一种自动完成标签的方法。我在下面提供了一个 GIF 图片来说明我的意思。
我提供了一个代码,我尝试使用组件本身进行调试,但它不起作用。
if (textEditorControl1.Text.Contains("<html>"))
{
textEditorControl1.ActiveTextAreaControl.SelectionManager.SelectedText("</html>");
}
ICsharpCode.TextEditor组件没有与普通 Textbox 相同的属性。
if (textBox2.Text.Contains("<html>"))
{
textBox2.SelectedText = "</html>";
}
如果我尝试调试TextBox版本,我会无数次得到标签,直到我得到一个未处理的 System.StackOverflowException。
解决方案
我在这里找到了你要找的东西。唯一的事情是,这是一个普通TextBox的工作代码。
推荐阅读
- swift - 如何在swift的if语句中使用两个let变量
- python - vscode一直显示linter pylint未安装
- ios - 从通知中设置 UILabel 的文本适用于模拟器,但不适用于物理设备
- sequelize.js - Sequelize Migration 无法识别现有表
- canvas - 调整 Vue.js 画布元素的大小
- python - Django:Internet Explorer 发布一个空表单
- javascript - Vue.js中如何操作DOM
- kubernetes - 如何根据负载自动缩放 pod 数量?
- php - 单击功能上的 Jquery 不适用于 wordpress,但适用于本地主机 xamp html 设计
- php - PHP - 打印未打印的RAW(热敏打印机)