自定义DataGridViewTextBoxColumn中的文本 [英] Customizing Text in a DataGridViewTextBoxColumn

查看:66
本文介绍了自定义DataGridViewTextBoxColumn中的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个单元格中显示了以下文本,我只需要将文本的一部分更改为粗体,就无法弄清楚.我如何修改类似Richtextbox的文本,其中字符串中的某些文本为粗体,其余部分为非.我需要将启用RDC"设置为粗体,每一行都有通过xml文件添加的不同文本.以下代码是我添加行的方式:

I have the below text show up in a cell that i need to change just one part of the text to bold and cant figure it out. How can i modify text like a richtextbox where some text in a string is bold and the rest isnt. I need to make "Enable RDC" bold, each row has different text that gets added via xml file. the below code is how i add a row:

Dim Rinfo As String = fName & "-" & fKM & vbCrLf & "" & fEmail

DataGridView1.Rows.Add(Rinfo)




文字字串:
启用RDC-dd000000
email @ .com




Text String:
Enable RDC - dd000000
email@.com

推荐答案

您必须选择要设置格式的文本.这是通过插入符位置完成的.您可以在这里看到一个示例:
http://social.msdn.microsoft.com /Forums/zh-CN/wpf/thread/5c90ecbc-9728-4c59-a9ea-d2b61b07ddbc/ [
You have to select the text you want to format. This is done through the caret position. You can see one example of it here:
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/5c90ecbc-9728-4c59-a9ea-d2b61b07ddbc/[^]


这篇关于自定义DataGridViewTextBoxColumn中的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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