none
Ribbon Dropdown scrollbar based on size of items RRS feed

  • Question

  • Hi. Currently populating ribbon dropdown programmatically and needed to specify a size for dropdown before scrollbar kicks in. Is this possible? Thanks
    Friday, November 18, 2011 2:18 PM

Answers

  • The dropdown control supports the attribute (property, if you're using the Designer sizeString. But as far as I know, this must be set at design time. There's no "get" type of attribute that will let you change the size at run-time...

    Edit: What you could perhaps do would be to define multiple dropdown controls, using sizeString to define various widths, and all with a getVisible attribute. Figure out which you want to use before populating the list entries, invalidate that control (or all of them) so that it becomes visible, then populate the list.


    Cindy Meister, VSTO/Word MVP

    Friday, November 18, 2011 6:58 PM
    Moderator

All replies

  • Hi,

    The following shows how we can use the sizeString to define the control's size.

    <comboBox id=”rxcboName”
    label=”Name:”
    sizeString=”xxxxxxx”
    maxLength=”8”
    screentip=”Enter the name.”
    onChange=”rxcboName_OnChange”/>
    


    Kind regards, Dennis (http://xldennis.wordpress.com/)
    Friday, November 18, 2011 6:49 PM
  • The dropdown control supports the attribute (property, if you're using the Designer sizeString. But as far as I know, this must be set at design time. There's no "get" type of attribute that will let you change the size at run-time...

    Edit: What you could perhaps do would be to define multiple dropdown controls, using sizeString to define various widths, and all with a getVisible attribute. Figure out which you want to use before populating the list entries, invalidate that control (or all of them) so that it becomes visible, then populate the list.


    Cindy Meister, VSTO/Word MVP

    Friday, November 18, 2011 6:58 PM
    Moderator
  • Thanks. For dropdown control i need the height to be fixed to a certain size and not the width (using sizeString). Is there any property to stipulate the maximum height and if anything beyond would result in an automatic scrollbar?
    Friday, November 18, 2011 8:20 PM
  • No, there's no way to set the height (number of displayed rows).
    Cindy Meister, VSTO/Word MVP
    Friday, November 18, 2011 8:33 PM
    Moderator