|
-
Apr 12th, 2004, 09:00 PM
#1
Thread Starter
Lively Member
bold in a label (resolved)
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
Last edited by beowulf; Apr 12th, 2004 at 09:09 PM.
-
Apr 12th, 2004, 09:03 PM
#2
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
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Apr 12th, 2004, 09:04 PM
#3
Lively Member
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...
-
Apr 12th, 2004, 09:08 PM
#4
Thread Starter
Lively Member
thanks all, not the answer i wanted but what can you do.
-
Apr 12th, 2004, 09:09 PM
#5
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"
-
Apr 12th, 2004, 09:16 PM
#6
Wow. It seems so stupid for me not to think about that..
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|