how can i have one label with some of the text be normal text and but the rest of it text would be in bold. thanks
Printable View
how can i have one label with some of the text be normal text and but the rest of it text would be in bold. thanks
You can't. You need to use the RichTextBox control, set its Borderstyle property to None, locked property to True, and then you can use it like this:
VB Code:
RichtextBox.SelBold = True RichTextBox.SelText = "This is bold," RichTextBox.SelBold = False RichTextBox.SelText = " and this is not"
EDIT:
If you don't know how to add a RichTextBox to your program, right click the toolbox (the thing where all the other controls are, on the left in VB), and click Components...
When the window appears, scroll down until you see "Microsoft RichTextBox Control", tick that, and click OK
Phreak
you can't make individual words in a single label bold or not......the only way to do this would be to seperate all the words in the label, store them into strings, and then place them back in label manually......all this of course would be a pain....so you probabaly want to not do it...
thanks all, not the answer i wanted but what can you do.
You can go a little further than «°°phReAk°°»'s example. Put a RichTextBox inside a frame and use code like the following:
VB Code:
RichTextBox1.Appearance = rtfFlat ' Set this at design time RichTextBox1.BorderStyle = rtfNoBorder RichTextBox1.BackColor = Me.BackColor RichTextBox1.TabStop = False Frame1.Enabled = False Frame1.BorderStyle = 0 RichTextBox1.Text = "Please press the " RichTextBox1.SelStart = 18 RichTextBox1.SelItalic = True RichTextBox1.SelBold = True RichTextBox1.SelText = "&xxx& " RichTextBox1.SelStart = 26 RichTextBox1.SelItalic = False RichTextBox1.SelBold = False RichTextBox1.SelText = " button"
Wow. It seems so stupid for me not to think about that.. :blush:
Phreak