matt_1ca Level: Scholar
 Registered: 27-03-2005 Posts: 42
|
Re: How Do I Change The Number of Items Shown in a Drop Down at Runtime
My dim statements look something like this:
Dim lstimg as ListImage, intCnt as integer
Dim strTextOnCombo as string, strKeyForImage
Dim cboItData as ComboItem
Dim strPathToMyBMPfile as string, i as integer
I add an image into my imagelist (my image list control's name is imglstLayer) control
from there associate the imagelist with the added image to my imageCombo (imgCbo)
then add the combo item itself -- something like:
for i = 1 to intCnt
set lstimg = imglstLayer.ListImages.Add(strKeyForImage & cstr(intCnt),LoadPicture(strPathToMyBMPfile))
with imgCbo
.imageList = imglstLayer
set cboitData = .ComboItems.Add(intCnt,, strTextOnCombo, strKeyForImage & cstr(intCnt))
end with
next i
I did some additional experiments and concluded that for ordinary comboboxes the total number of rows default to 8 whereas for image combo it defaults to 9.
The listcount property of the ordinary combobox wont be of great help because it is read only and even it it were not still it wont be able to totally help as what it is giving is the number of items total for the dropdown and not the number of items I want to be visible per "page" of the drop down list.
For example if I had twenty comboitems and want to display 10 items at a time, doing a
combo.listcount yields 20 which thus cannot be used to directly tell the computer that I want 10 items per page.
Moreover the imagecombo does not seem to have a listcount property, so listcount property is definitely ruled out.
The only reason I cannot accept as impossible what I am trying to do is because I have seen some applications do it. For example in the layer toolbar of AutoCAD you will see that they were able to stretch the size of an imagecombo so that it has at least 25 rows in it as opposed to the default of 9.
Thank you so much for all the kind help you can give.
Gratefully,
Matt
|