Discussion:
String Item getting truncated in ComboBox
(too old to reply)
a***@gmail.com
2007-10-23 08:54:03 UTC
Permalink
Hi

I have a combo box that is not owner draw. I am populating the items
in combo box using SendMessage with CB_ADDSTRING. But there is one
problem that I am facing. The width of the drop down list of combo box
is fixed. If I add string with text length more than the width of
combo box, the full string item is not visible. Some part of the
string gets truncated. Please suggest me the solution for this problem

Thanks in advance
-Abhay
David Lowndes
2007-10-23 09:11:02 UTC
Permalink
Post by a***@gmail.com
I have a combo box that is not owner draw. I am populating the items
in combo box using SendMessage with CB_ADDSTRING. But there is one
problem that I am facing. The width of the drop down list of combo box
is fixed. If I add string with text length more than the width of
combo box, the full string item is not visible. Some part of the
string gets truncated. Please suggest me the solution for this problem
You can alter the width of the drop-list using
CComboBox::SetDroppedWidth.

Dave
Joseph M. Newcomer
2007-10-25 00:18:42 UTC
Permalink
Two solutions. Both require that you track the string lengths. See my essay on doing
this for a CLIstBox; you would do the same for a combo box

http://www.flounder.com/hscroll.htm

But in a combo box, you can also use CComboBox::SetDroppedWidth to set the dropdown size
to be wide enough to hold the widest string.
joe
Post by a***@gmail.com
Hi
I have a combo box that is not owner draw. I am populating the items
in combo box using SendMessage with CB_ADDSTRING. But there is one
problem that I am facing. The width of the drop down list of combo box
is fixed. If I add string with text length more than the width of
combo box, the full string item is not visible. Some part of the
string gets truncated. Please suggest me the solution for this problem
Thanks in advance
-Abhay
Joseph M. Newcomer [MVP]
email: ***@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
d***@lexmark.com
2012-09-07 06:44:34 UTC
Permalink
Anoth
Post by a***@gmail.com
Hi
I have a combo box that is not owner draw. I am populating the items
in combo box using SendMessage with CB_ADDSTRING. But there is one
problem that I am facing. The width of the drop down list of combo box
is fixed. If I add string with text length more than the width of
combo box, the full string item is not visible. Some part of the
string gets truncated. Please suggest me the solution for this problem
Thanks in advance
-Abhay
Another thing you can do is use Horizontal and Vertical Scroll bar
Loading...