PDA

View Full Version : ComboBox Bold Items



PetarStan
04-15-2012, 11:35 PM
Hi

I am doing a powerpoint presentation with a combobox with options. I have written a code for adding and coloring the items in the combobox but i would also like to make these items bold. How do i do that?
My code looks accordingly:




Private Sub ComboBox1_DropButtonClick()
If ComboBox1.ListCount = 0 Then
ComboBox1.AddItem ""
ComboBox1.AddItem "Passed"
ComboBox1.AddItem "Not Passed"
ComboBox1.AddItem "Follow-Up"
ComboBox1.AddItem "blue"
End If
End Sub

Private Sub ComboBox1_Change()

If ComboBox1.ListIndex = 1 Then
ComboBox2.Style = Bold
ComboBox1.ForeColor = RGB(0, 150, 0)
ElseIf ComboBox1.ListIndex = 2 Then
ComboBox1.ForeColor = RGB(150, 0, 0)
ElseIf ComboBox1.ListIndex = 3 Then
ComboBox1.ForeColor = RGB(255, 200, 0)
ElseIf ComboBox1.ListIndex = 4 Then
ComboBox1.ForeColor = RGB(0, 0, 150)
End If

End Sub


Private Sub ComboBox2_Change()

End Sub

Thank you for your help

John Wilson
04-16-2012, 01:57 AM
Try

ComboBox1.Font.Bold=True (or False)

I guess you know you cannot change just one entry - they will all change (but you will only see the chosen one maybe)