制作字符串Bold的一部分 [英] Making a part of the string Bold

查看:100
本文介绍了制作字符串Bold的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个字符串:Inventory(2)。我想在屏幕上显示(2)粗体。如何实现。

I have a string : "Inventory (2)".I want to make "(2)" bold while displaying in the screen.How to achieve that.

推荐答案

我认为下面提到的链接可以解决你的问题







http://msdn.microsoft.com/en-us/library/system.windows.forms。 treeview.drawnode.aspx [ ^ ]
I think below mentioned link can solve your problem



http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.drawnode.aspx[^]


您需要自己处理 DrawNode 。使用drawmode OwnerDrawText 就足够了,因为您只想自定义文本样式。看看下面的链接:



http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.drawnode.aspx#Y570 [ ^ ]



祝你好运!
You would need to handle the DrawNode yourself. Using drawmode OwnerDrawText would be enough because you just want to customize the text style. Have a look at the link below:

http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.drawnode.aspx#Y570[^]

Good luck!


有两篇CodeProject文章提供了非常有用的控件,可以根据HTML格式进行操作。



请参阅:

对于System.Windows.Forms:您将使用的专业HTML渲染器 [ ^ ],
WPF的
WPF HTML支持的TextBlock [ ^ ]。



下次,请始终标记您想要的UI库使用。



-SA
There are two CodeProject article offering very helpful controls to do this based on HTML format.

See:
For System.Windows.Forms: A Professional HTML Renderer You Will Use[^],
for WPF: WPF HTML Supported TextBlock[^].

Next time, please always tag UI library you want to use.

—SA


这篇关于制作字符串Bold的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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