By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,222 Members | 1,129 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,222 IT Pros & Developers. It's quick & easy.

hiding combobox button

P: n/a
I may have already asked this one, but,

Is there anyway of hiding the dropdown control button on a combobox until
the field has focus?

Because the values in the combobox can be between 5 charicters long and
thirty charicters long, this poses the problem that when a five charicter
string is selected, the button looks a mile away. I have the background of
the combobox set to transparent, but the button still appears

What to do...what to do?

Thanks

Tim
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Tim Graichen wrote:
I may have already asked this one, but,

Is there anyway of hiding the dropdown control button on a combobox until
the field has focus?

Because the values in the combobox can be between 5 charicters long and
thirty charicters long, this poses the problem that when a five charicter
string is selected, the button looks a mile away. I have the background of
the combobox set to transparent, but the button still appears

What to do...what to do?


Only using a hack - create a rectangle and set its back color and border
color to the back color of the appropriate (Detail?) section of your form
and place it as best you can over the button.

--
'-------------------------------
' John Mishefske
'-------------------------------

Nov 12 '05 #2

P: n/a
OK, but in doing so, you have effectively perminantly covered up the
button.. correct? In order to use this hack. the combo box needs to drop
down on GotFocus rather that clicking on the button...correct?

What about taking the value of the combobox selection, and copying it to a
variable. Then set the combobox to invisible and a text box (that overlays
the combobox) to visible and pasting the variable.

This is an idea that was proposed by someone else. Perhaps somebody could
clean up my crummy coding and prove it out? Please! :-)

Private Sub TxtBox_GotFocus ()
Dim HOLD as string
HOLD.Value=Me.TxtBox.Value
Me.TxtBox.Visible=False
Me.CboBox.Visible=True
Me.CboBox.Value=HOLD.Value
End Sub

Private Sub CboBox_LostFocus
HOLD.Value=CboBox.value 'Store the new ComboBox value
CboBox.Visible=False
TxtBox.Visible=True
TxtBox.Value=HOLD.Value
End Sub

TG


"John Mishefske" <mi****@execpc.com> wrote in message
news:vm************@corp.supernews.com...
Tim Graichen wrote:
I may have already asked this one, but,

Is there anyway of hiding the dropdown control button on a combobox until the field has focus?

Because the values in the combobox can be between 5 charicters long and
thirty charicters long, this poses the problem that when a five charicter string is selected, the button looks a mile away. I have the background of the combobox set to transparent, but the button still appears

What to do...what to do?


Only using a hack - create a rectangle and set its back color and border
color to the back color of the appropriate (Detail?) section of your form
and place it as best you can over the button.

--
'-------------------------------
' John Mishefske
'-------------------------------

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.