Jump to content

underline string

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
Siten0308

Siten0308

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 302 posts
Hello,

wondering if there is a way to underline a string, which will go into a list and stay underlined? is there anyway to do that?
Its only funny till someone gets hurt.... THEN ITS HILARIOUS :)

#2
veda87

veda87

    Programmer

  • Members
  • PipPipPipPip
  • 126 posts
I doubt whether we can directly underline a string directly... But you can do something like this.

static void Main(string[] args)
        {
            string asd = new string('\u0332', 7);

            List<string> name = new List<string>();

            name.Add("Example");
            name.Add(asd);
            name.Add("Test");

            foreach (string abc in name)
            {
                Console.WriteLine(abc);
            }
            Console.Read();
        }

Hope this helps...

#3
Siten0308

Siten0308

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 302 posts
thanks for the reply back,

sorry but also wanted to ask, besides under line, is it possible to color a string, or a certain row in a list or listviewitem?such as
listviewitem lvi = new listviewitem()
lvi.text = row.column1.color = red.

etc. etc.

is that anyway possible or how about just coloring a certain column etc instead of a row? let me know if its possible to do either or both.
Its only funny till someone gets hurt.... THEN ITS HILARIOUS :)

#4
veda87

veda87

    Programmer

  • Members
  • PipPipPipPip
  • 126 posts
I don't have much idea about it... But you can check this link: ListViewItem.ListViewSubItemCollection.Add Method (String, Color, Color, Font) (System.Windows.Forms)

this might help you... If you find the solution, do let us know...