格式化DSL工具提示 [英] Formatting DSL Tooltips

查看:341
本文介绍了格式化DSL工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

是否可以在DSL工具中自定义形状工具提示的格式?例如,假设我要制作类似于工具箱元素的工具提示,其中该元素的显示名称以粗体显示,然后在标准文本下面的多行中显示说明.

我只能看到的定制步骤是将ToolTip类型设置为变量并实现GetVariableTooltipText()吗?可以在字符串中放置一些特殊字符来表示这种格式吗?

最诚挚的问候,感谢您迄今为止提供的所有帮助,

Gonçalo

Hi all,

Is it possible to customize the formatting of shape tooltips in DSL Tools? For instance, suppose I want to make something like the toolbox elements' tooltip, in which the display name of the element is shown in bold, and then the description is shown in multiple lines below in standard text.

The only customization step I can see is setting the ToolTip type to variable and implementing GetVariableTooltipText()? Is there some special characters I can place in the string to indicate such formatting?

Best regards and thanks for all your help so far,

Gonçalo

推荐答案

无法在工具提示中加粗文本,但可以将其格式设置为以下格式:

It is not possible to bold the text in a tooltip, but you can format the text as bellow:

        public override string GetToolTipText(DiagramItem item)
        {
            string toolTip = "Name \t: MyName";
            toolTip = string.Concat(toolTip, "\nDescription \t: This is my description.");

            return toolTip;
        }


这篇关于格式化DSL工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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