Get color of a string
-
Hi There, Can anyone tell me how to get the color of a string? E.g.: I am passing a string to a function. The function needs to return the color of that string. public Color GetColor(string); I am extracting this string from a RichTextBox line. Thanks in advance. ----------------------------------------------- "Don't crib about your job. Only 1% are doing something meaningful and I have never seen any of them."
-
Hi There, Can anyone tell me how to get the color of a string? E.g.: I am passing a string to a function. The function needs to return the color of that string. public Color GetColor(string); I am extracting this string from a RichTextBox line. Thanks in advance. ----------------------------------------------- "Don't crib about your job. Only 1% are doing something meaningful and I have never seen any of them."
Hi, a string has no color, it only holds characters. an RTB can show a string with extra attributes such as font style, color, e.a. You can get or set the color of some text INSIDE an RTB using RichTextBox.SelectionColor(). :)
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips: - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use PRE tags to preserve formatting when showing multi-line code snippets
-
Hi, a string has no color, it only holds characters. an RTB can show a string with extra attributes such as font style, color, e.a. You can get or set the color of some text INSIDE an RTB using RichTextBox.SelectionColor(). :)
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips: - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use PRE tags to preserve formatting when showing multi-line code snippets