Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default retract dropdown for combobox


Is there a way to programmatically retract the dropdown list for a combobox
on a form?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default retract dropdown for combobox


See VBA help

ShowDropButtonWhen Property

fmShowDropButtonWhenNever 0 Do not show the drop-down button under
anycircumstances.
fmShowDropButtonWhenFocus 1 Show the drop-down button when the control has
the focus.
fmShowDropButtonWhenAlways 2 Always show the drop-down button.


"joeeng" wrote:

Is there a way to programmatically retract the dropdown list for a combobox
on a form?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default retract dropdown for combobox


Thanks, Joel
However, this is not quite what I am looking for. I would like to hide
(retract) the dropdown list itself (not the button) when the user types
something in the combobox that does not match anything in the dropdown list.
I have worked out the procedure, but I cannot figure out how to get the
dropdown list to hide itself. Dropdown method makes it appear, but what
makes it retract?
"Joel" wrote:

See VBA help

ShowDropButtonWhen Property

fmShowDropButtonWhenNever 0 Do not show the drop-down button under
anycircumstances.
fmShowDropButtonWhenFocus 1 Show the drop-down button when the control has
the focus.
fmShowDropButtonWhenAlways 2 Always show the drop-down button.


"joeeng" wrote:

Is there a way to programmatically retract the dropdown list for a combobox
on a form?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default retract dropdown for combobox


What about disable the combobox? You can check the properties window in the
userform (select combobox) to see all the options. You can change them
manual in the property window so you can see the effectr of each change
before adding code to perform same operation. If the property window doesn't
display the go to menu View to add the window.

"joeeng" wrote:

Thanks, Joel
However, this is not quite what I am looking for. I would like to hide
(retract) the dropdown list itself (not the button) when the user types
something in the combobox that does not match anything in the dropdown list.
I have worked out the procedure, but I cannot figure out how to get the
dropdown list to hide itself. Dropdown method makes it appear, but what
makes it retract?
"Joel" wrote:

See VBA help

ShowDropButtonWhen Property

fmShowDropButtonWhenNever 0 Do not show the drop-down button under
anycircumstances.
fmShowDropButtonWhenFocus 1 Show the drop-down button when the control has
the focus.
fmShowDropButtonWhenAlways 2 Always show the drop-down button.


"joeeng" wrote:

Is there a way to programmatically retract the dropdown list for a combobox
on a form?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default retract dropdown for combobox


Joel,
Based on your idea, a simple workaround worked.

Combobox.Enabled=False
Combobox.Enabled=True
Combobox.SetFocus

This hides the dropdown list and returns to the combobox exactly where the
user left off typing the new entry.

Thanks for the idea.

"Joel" wrote:

What about disable the combobox? You can check the properties window in the
userform (select combobox) to see all the options. You can change them
manual in the property window so you can see the effectr of each change
before adding code to perform same operation. If the property window doesn't
display the go to menu View to add the window.

"joeeng" wrote:

Thanks, Joel
However, this is not quite what I am looking for. I would like to hide
(retract) the dropdown list itself (not the button) when the user types
something in the combobox that does not match anything in the dropdown list.
I have worked out the procedure, but I cannot figure out how to get the
dropdown list to hide itself. Dropdown method makes it appear, but what
makes it retract?
"Joel" wrote:

See VBA help

ShowDropButtonWhen Property

fmShowDropButtonWhenNever 0 Do not show the drop-down button under
anycircumstances.
fmShowDropButtonWhenFocus 1 Show the drop-down button when the control has
the focus.
fmShowDropButtonWhenAlways 2 Always show the drop-down button.


"joeeng" wrote:

Is there a way to programmatically retract the dropdown list for a combobox
on a form?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default retract dropdown for combobox


I finally remembered the right way to do it. set index number to -1.

"joeeng" wrote:

Joel,
Based on your idea, a simple workaround worked.

Combobox.Enabled=False
Combobox.Enabled=True
Combobox.SetFocus

This hides the dropdown list and returns to the combobox exactly where the
user left off typing the new entry.

Thanks for the idea.

"Joel" wrote:

What about disable the combobox? You can check the properties window in the
userform (select combobox) to see all the options. You can change them
manual in the property window so you can see the effectr of each change
before adding code to perform same operation. If the property window doesn't
display the go to menu View to add the window.

"joeeng" wrote:

Thanks, Joel
However, this is not quite what I am looking for. I would like to hide
(retract) the dropdown list itself (not the button) when the user types
something in the combobox that does not match anything in the dropdown list.
I have worked out the procedure, but I cannot figure out how to get the
dropdown list to hide itself. Dropdown method makes it appear, but what
makes it retract?
"Joel" wrote:

See VBA help

ShowDropButtonWhen Property

fmShowDropButtonWhenNever 0 Do not show the drop-down button under
anycircumstances.
fmShowDropButtonWhenFocus 1 Show the drop-down button when the control has
the focus.
fmShowDropButtonWhenAlways 2 Always show the drop-down button.


"joeeng" wrote:

Is there a way to programmatically retract the dropdown list for a combobox
on a form?

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default retract dropdown for combobox


I tried setting listindex to -1 and this is what I found. Setting the
listindex to -1 merely removes the selection focus from the dropdown. It
does not hide the dropdown list.

"Joel" wrote:

I finally remembered the right way to do it. set index number to -1.

"joeeng" wrote:

Joel,
Based on your idea, a simple workaround worked.

Combobox.Enabled=False
Combobox.Enabled=True
Combobox.SetFocus

This hides the dropdown list and returns to the combobox exactly where the
user left off typing the new entry.

Thanks for the idea.

"Joel" wrote:

What about disable the combobox? You can check the properties window in the
userform (select combobox) to see all the options. You can change them
manual in the property window so you can see the effectr of each change
before adding code to perform same operation. If the property window doesn't
display the go to menu View to add the window.

"joeeng" wrote:

Thanks, Joel
However, this is not quite what I am looking for. I would like to hide
(retract) the dropdown list itself (not the button) when the user types
something in the combobox that does not match anything in the dropdown list.
I have worked out the procedure, but I cannot figure out how to get the
dropdown list to hide itself. Dropdown method makes it appear, but what
makes it retract?
"Joel" wrote:

See VBA help

ShowDropButtonWhen Property

fmShowDropButtonWhenNever 0 Do not show the drop-down button under
anycircumstances.
fmShowDropButtonWhenFocus 1 Show the drop-down button when the control has
the focus.
fmShowDropButtonWhenAlways 2 Always show the drop-down button.


"joeeng" wrote:

Is there a way to programmatically retract the dropdown list for a combobox
on a form?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
opposite of dropdown in combobox sunilpatel Excel Programming 0 May 13th 09 01:32 AM
Combobox dropdown list??????????? Tdp Excel Discussion (Misc queries) 3 November 25th 08 10:03 PM
ComboBox dropdown list? Tdp Excel Discussion (Misc queries) 0 October 14th 08 11:34 PM
Combobox.DropDown not working Corey ....[_2_] Excel Programming 2 July 7th 08 06:54 AM
combobox dropdown pswanie Excel Programming 6 January 19th 08 04:21 PM


All times are GMT +1. The time now is 03:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"