| View previous topic :: View next topic |
| Author |
Message |
Mitesh2004 Freshman
Joined: 26 Jan 2004 Posts: 43
|
Posted: Mar 10th, 2004 10:23 AM Post subject: Changing colour and font in label caption |
|
|
Hello,
I have a label with the following code:
| Code: | | lblOSMissed.Caption = "Percentage of Overall Shots Missed: " & Format(1 - OverallShot**** / OverallShots, "percent") |
How would i make only the actual pecentage at the end to appear Red and in Bold text?
I would appreciate any help. Cheers! |
|
| Back to top |
|
Gilad_r Centurion
Joined: 03 Mar 2004 Posts: 156
|
Posted: Mar 10th, 2004 12:22 PM Post subject: |
|
|
you wouldn't.. try using two labels:
one with the regular text and another with the red & bold text _________________ "you should make amends with you" (Incubus) |
|
| Back to top |
|
Mitesh2004 Freshman
Joined: 26 Jan 2004 Posts: 43
|
Posted: Mar 10th, 2004 01:09 PM Post subject: |
|
|
hmmmm.....
I dont really want to use a sepatate label. Are you positive that there is no other way to do this?
Isnt there some sort of function like Chr(vbKeyReturn) but for making text bold? |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Mar 10th, 2004 04:14 PM Post subject: |
|
|
Use a Rich Text Box with the Appearence =0 ,Borderstyle = 0 and Enabled =False. Change the backcolor also if you want. Then you can do :
[vb:1:114ba5d3fd]Private Sub Form_Load()
OverallShot = 7
OverallShots = 17
RichTextBox1.Text = "Percentage of Overall Shots Missed: " & Format(1 - OverallShot / OverallShots, "percent")
RichTextBox1.SelStart = 36
RichTextBox1.SelLength = Len(RichTextBox1.Text)
RichTextBox1.SelColor = vbRed
RichTextBox1.SelBold = True
RichTextBox1.SelStart = Len(RichTextBox1.Text)
End Sub[/vb:1:114ba5d3fd] _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
|