Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apply bullet style to a label using C#

Tags:

c#

label

I am displaying a message on a asp label when user is successfully saved. I want to append a bullet in starting of the message. So, I tried the following code but it coluld not help me.

lblSuccessMsg.Text = BulletStyle.Disc + " '" + obj.record + "' saved successfully.";

the output of the message is :

'Record' saved successfully.

How can i do the same using C#.

like image 540
karthik k Avatar asked Nov 26 '10 11:11

karthik k


2 Answers

In C#, you could simply add the bullet in your string by its unicode number.

lblSuccessMsg.Text = "\u2022 '" + obj.record + "' saved successfully.";
like image 55
Marcel Gheorghita Avatar answered Sep 29 '22 16:09

Marcel Gheorghita


In addition to Marcel Gheorghita's answer there's some more unicode bullet chars:

‣ \u2023 (TRIANGULAR BULLET)
◦ \u25E6 (WHITE BULLET)
◉ \u25C9 (FISHEYE)
■ \u25A0 (BLACK SQUARE)
□ \u25A1 (WHITE SQUARE)
❏ \u274F (LOWER RIGHT DROP-SHADOWED WHITE SQUARE)
like image 41
VVS Avatar answered Sep 29 '22 16:09

VVS