I would like to be able to highlight a given word in the
example label using another color than the rest of the
words in the sentence and/or maybe underline the
highlighted word.
Said another way...Does labels support in-line font/color
tags for setting text properties such as HTML does?
If not... then I guess I will need to dynamically
concatenate and display labels on the form for each word
using the desired font/color to build out the sentence.
If I want to do this sizing at run time then how can I
know how much width (pixels) to allocate for each label
such that I can place them neatly end to end?
Maybe I should be using a text box??
In my opinion you can use GDI, however when it was my problem I would first
look what the Rich Text Box could do for me. (I never have done this
problem)
Cor.
Full ACK. The RichTextBox is the way to go (locked + cursor set to an
arrow etc.).
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Here is Hello World written to MyRichTextBox
rtbMyRichTextBox.SelectionFont = New Font("arial", 12,
FontStyle.Bold)
rtbMyRichTextBox.SelectionColor = Color.Red
rtbMyRichTextBox.SelectedText() = "Hello "
rtbMyRichTextBox.SelectionFont = New Font("arial", 10,
FontStyle.Bold)
rtbWordSentence.SelectionColor = Color.Black
rtbMyRichTextBox.SelectedText() = "World"
>.
>
But what does "set to arrow mean"?
Just wondering.
Thanks!
>.
>
The cursor is the mouspointer, that is normal the Arrow, so you can set that
to an arrow for that box
\\\\
Me.RichTextBox1.Cursor = Cursors.Arrow
////
Cor
ACK. In addition to that, we must prevent the user from selecting
text... I am not sure at the moment how to do that.