B
bdscarboro
Folks,
I need to set the height of a listbox based on the number of items
it contains such that its height contains all the items perfectly with
no scroll bar. With a WinForms listbox, there is the ItemHeight
property, but apparently there is no equivalent with the WebControls
listbox? I have tried using the Rows property with no success. As a
temporary solution, I have done this:
lstNames.Height = lstNames.Items.Count * 13
Since each item is 13 pixels high on my screen, this works perfectly on
my machine, but I'm a little worried about other displays with
different resolution etc.
Is there a programmatic way to determine the height of an item in the
listbox?
Thanks in advance for any tips ...
I need to set the height of a listbox based on the number of items
it contains such that its height contains all the items perfectly with
no scroll bar. With a WinForms listbox, there is the ItemHeight
property, but apparently there is no equivalent with the WebControls
listbox? I have tried using the Rows property with no success. As a
temporary solution, I have done this:
lstNames.Height = lstNames.Items.Count * 13
Since each item is 13 pixels high on my screen, this works perfectly on
my machine, but I'm a little worried about other displays with
different resolution etc.
Is there a programmatic way to determine the height of an item in the
listbox?
Thanks in advance for any tips ...