Thread Rating:
  • 364 Vote(s) - 2.88 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dropdownlist: height changes when selected?
07-27-2011, 01:05 PM,
#1
Dropdownlist: height changes when selected?

When nothing is selected (null), the height shrinks. When something is selected, the height expands.


Is there any way to prevent this from happening, other than to set its default value as " ".
07-27-2011, 01:24 PM,
#2
RE: Dropdownlist: height changes when selected?
(07-27-2011, 01:05 PM)swan Wrote: When nothing is selected (null), the height shrinks. When something is selected, the height expands.


Is there any way to prevent this from happening, other than to set its default value as " ".

This often happens when your list items are of variable size, or the first item is "", or the control otherwise has labels that don't match the height of the font used by the DropdownList. You might try setting font[-size] on the control itself if you're setting it on each label currently. You can also set the height on the DropdownList itself, if you have usable size.

Otherwise, the easiest workaround is to, as you suggest, do something like:

Code:
{value
    def li = {ListValueItem "", label = {text \ }}
    def ddl =
        {DropdownList
            li,
            "asd",
            "asdasda",
            value = ""
        }
    ddl
}

That workaround is also the better way to display a "" (empty String) option.
07-27-2011, 01:32 PM,
#3
Thumbs Up  RE: Dropdownlist: height changes when selected?
Will give it a try.


Thank you!


Possibly Related Threads...
Thread Author Replies Views Last Post
  DropdownList のリスト表示のショートカット umemura 1 2,884 02-24-2014, 05:34 PM
Last Post: umemura
  DropdownList へのListValueItem の設定方法は? umemura 1 2,836 02-02-2014, 07:13 PM
Last Post: dyoshida
  選択後の DropdownList のラベルをカスタマイズしたい umemura 0 2,872 04-02-2013, 05:42 PM
Last Post: umemura
  DropdownList でラベルが選択できない umemura 1 3,416 02-04-2013, 03:49 PM
Last Post: usami
  How to measure ListValueItem.label width in Dropdownlist kingcesc 1 2,941 11-15-2012, 12:07 PM
Last Post: kingcesc
  DropdownList のリストを表示 umemura 4 4,595 11-21-2011, 10:12 AM
Last Post: c-s
  DropdownList のボタンが欲しい umemura 2 3,909 11-21-2011, 10:08 AM
Last Post: c-s
Forum Jump:


Users browsing this thread:
3 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('161')