Combo Box (ControlTipText)

adambc

Active Member
Joined
Jan 13, 2020
Messages
368
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
ControlTipText appears when the User hovers over the Combo Box ...

Is there anyway of displaying this text in grey in the Combo Box?

Similar to the way in which many online forms do.

Thanks ...
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Is the combobox in a userform? Consider this option
Insert a label above the combobox (Label1)
Paste controltip text into Label1 and amend Label1 properties to render the text grey
Make Label1 non-visible until user hovers over the combobox
Leave Label1 visible whilst the mouse is over the combobox

Example code
VBA Code:
Private Sub UserForm_Initialize()
    ShowLabel False
End Sub
Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    ShowLabel False
End Sub
Private Sub ComboBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    ShowLabel True
End Sub
Private Sub ShowLabel(X As Boolean)
    Label1.Visible = X
End Sub
 
Upvote 0
Thanks, but that doesn’t give me much/any more than simply adding the text to the ControlTipText Combo Box property ...

What I was hoping for is for the text to be visible in the Combo Box When the UserForm loads ...

My text is “Select From List or Enter Manual Value” (or words to that effect (the Combo Box property is set to allow a manual entry) ...

Any more ideas anyone?

Thanks ...
 
Upvote 0
What I was hoping for is for the text to be visible in the Combo Box When the UserForm loads ...
in which case ....
VBA Code:
Private Sub UserForm_Initialize()
    ShowLabel True
End Sub
 
Upvote 0
Another idea

VBA Code:
Private Sub UserForm_Initialize()
    ComboBox1.Value = ComboBox1.ControlTipText
End Sub

Private Sub ComboBox1_DropButtonClick()
    ComboBox1.Value = ""
End Sub
 
Upvote 0
Or you could use a label and place it above the combo box so that the text appears to be inside the box
(format it as preferred)

The text disappears when anything is selected or entered manually

VBA Code:
Private Sub UserForm_Initialize()
    Label1.Caption = ComboBox1.ControlTipText
End Sub
Private Sub ComboBox1_Change()
    Label1.Visible = False
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,484
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top