开发者

changing color of the part of label.text

开发者 https://www.devze.com 2022-12-13 10:58 出处:网络
How can i change color of just specific part of the label.text in visual basic 2010 express? Dim b As Integer = 34

How can i change color of just specific part of the label.text in visual basic 2010 express?

Dim b As Integer = 34

label.Text = "You have " & b.ToString & " new items"

for 开发者_运维问答example, i just want to change color of the "b" here.

or do i need to create a new label ?

Thanks


Assuming this is Windows Forms: you need to create a new label.

If it's WPF, you can do it by using a TextBlock with Run elements inside it, and setting the foreground of one of the Run elements.

0

精彩评论

暂无评论...
验证码 换一张
取 消