+ Reply to Thread
Results 1 to 7 of 7

Seeking Custom Control - Listbox & Combobox

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Seeking Custom Control - Listbox & Combobox

    I want to multi-select in a combobox. Which cant be done.

    And I can't use listbox as it doesn't allow the end user to add new values to the dropdown.

    So I need an alternative.


    Would it be possible to use a custom class to somehow create a control with the attributes of both listbox & combobox?

    Could it be done through API??


    I'm open to any suggestions on how this can be achieved.
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Seeking Custom Control - Listbox & Combobox

    Yes, I've created custom controls for you before. Just have a look at them and have a go - this won't be too difficult. Give it a try and see how far you get

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Seeking Custom Control - Listbox & Combobox

    Thanks Kyle. I hadn't thought of customising the code you refer to. Unfortunately I no longer have access to the project it was used in and I can't find the thread where you provided it to me.

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Seeking Custom Control - Listbox & Combobox

    Conceptually, it's similar to this - http://www.excelforum.com/excel-prog...-combobox.html albeit much more simple (depending on whether you want to get fancy with the filtering and searching). Consider instead of having a "drop down" frame containing controls have a listtbox set to multi-select

  5. #5
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Seeking Custom Control - Listbox & Combobox

    Quote Originally Posted by Kyle123 View Post
    Consider instead of having a "drop down" frame containing controls have a listtbox set to multi-select
    The problem with using a Listbox with multiselect is that the end user can't add new values.

    I am idly toying with the idea of placing a textbox and a listbox alongside each other and then coupling them together. I would only try this as a last resort because it wouldn't be aesthetically pleasing.

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Seeking Custom Control - Listbox & Combobox

    Why not? Place a text box with a button inside above a hidden list box with its effect set to flat. It will look identical to a combo box. You'd then just toggle the visibility of the list box when the button is clicked. If you were so inclined you could also filter the list box based on the input of the text box - though this is more complicated

  7. #7
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Seeking Custom Control - Listbox & Combobox

    Quote Originally Posted by Kyle123 View Post
    If you were so inclined you could also filter the list box based on the input of the text box - though this is more complicated
    I created that very thing a few weeks ago for another project. Entering strings in the textbox will cause the listbox to display filtered results. Then press a command button to clear the filter and view the original/unfiltered results.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Populating Userform ComboBox Using Items from Content Control Combobox
    By anarxo in forum Word Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2014, 01:00 PM
  2. Need PictureBox control from vb6(?) for UserForms, or equivalent custom control...
    By rogerdavis in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-31-2012, 12:54 PM
  3. Replies: 2
    Last Post: 12-07-2012, 02:10 AM
  4. Dim CTL as MSForms.Control always sets as Control/Combobox
    By Post Tenebras Lux in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-11-2006, 01:55 AM
  5. comboBox vs Listbox
    By Steve in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-13-2006, 08:26 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1