473,379 Members | 1,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

How can I change the list height for a ComboBox?

I am making a class dervied from ComboBox. The height of the items in the list will be changed by the program. I've gotten this to work with OnMeasureItem, but there is a large space left behind. For example, if their originally was 10 items each with a height of 20 and I changed the height of all of them to 10, then their would be a space of 100 that is blank and unselectable. I am using the following properties

mycombobox->DrawMode = DrawMode::OwnerDrawVariable
mycombobox->DropDownStyle = ComboBoxStyle::DropDownList

I'd like a function like the following

void MyComboBox::FixComboBoxListHeight()
int idx
int total_height

total_height = 0
for(idx=0; idx < Items->Count; idx++)
total_height += GetItemHeight(idx)
SetListHeight(total_height); /* I can't figure out how to do this. *
Any ideas

Nov 17 '05 #1
0 1504

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Austin | last post by:
.................. self.diskList = self.cB = wxComboBox(self,-1,wxDefaultPosition,wxDefaultSize,self.diskList) .................. The code is executed initially. If i want to update only the...
2
by: Thomas Wang | last post by:
I draw a combobox on a form, but I can not change its height, What I can do about it? B.Rgds
4
by: Maria | last post by:
When adding records through a datagrid I would like one of the fields only to accept the values 'Yes' or 'No' is it possible to set this field to some kind of combobox or list. The datatype for...
4
by: Rob Kroese | last post by:
I've got a form with a datagrid that displays a list of items, along with several textboxes, comboboxes, etc., that display the details for the selected item. The columns in the datagrid and the...
12
by: Sam | last post by:
Hi, Do you know where I can find a simple example of what I'm trying to achieve : I have a dataset filled with two columns from a table of my database. Then the dataset is used to fill a...
4
by: genojoe | last post by:
I have a combobox control on the form. When the user makes a change, I want to validate a condition before permitting the change. If the condition is not met, I want to return the ComboBox text...
13
by: nyt | last post by:
I have a problem of number and text field. I got the database file(mdb) that contains many combo boxes used and its list values are created by "value list" For eg field Field name= 'furniture'...
1
by: polocar | last post by:
Ciao a tutti, leggendo qua e lą per il forum ho scoperto che non sono l'unico ad avere questo problema. Se si inserisce un controllo ComboBox in un form di C#, non č possibile impostare la sua...
8
by: shruthiKKKK | last post by:
change appearence for textbox by using combolist
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.