The combo box is in a modeless dialog box, and has a vertical scrollbar,
and no integral height. It is of type "Drop List" and is set to "No" owner
draw. I am unable to make it any taller in the MS developer studio.
Thanks!
Sanford
In the studio, do the following:
Set the type to a regular list box.
Set the height to whatever you want the drop-down height of the
combo box to be.
Set the type back to a combo box.
The height of the control is the height of the drop down.
--
Brad Wilson Custom software development & solutions
cru...@pobox.com Internet and intranet consulting services
The Brads' Consulting Windows NT/Windows 95 software development
http://www.thebrads.com Web site planning, development and maintenance
Content (C) 1996 Brad Wilson; no reproduction without authorization
Use SetWindowPos. Remember to include the height of the associated
edit box, too. So, something like:
void set_DropDownSize(CComboBox& box, UINT LinesToShow)
// Notes:
// 1) use SM_CYBORDER for Win3.x or NT
// 2) This won't work for owner-draw variable height combo boxes
// 3) This won't work for a subclassed combo with a horizontal scroll bar
// 4) Call this function after creating the combo box and after a
// WM_SETTINGCHANGE message.
{
ASSERT(IsWindow(box)); // Window must exist or SetWindowPos won't work
CRect cbSize; // current size of combo box
int Height; // new height for drop-down portion of combo box
box.GetClientRect(cbSize);
Height = box.GetItemHeight(-1); // start with size of the edit-box
portion
Height += box.GetItemHeight(0) * LinesToShow; // add height of lines of
text
// Note: The use of SM_CYEDGE assumes that we're using Windows '95
// Now add on the height of the border of the edit box
Height += GetSystemMetrics(SM_CYEDGE) * 2; // top & bottom edges
// The height of the border of the drop-down box
Height += GetSystemMetrics(SM_CYEDGE) * 2; // top & bottom edges
// now set the size of the window
box.SetWindowPos(NULL, // not relative to any other windows
0, 0, // TopLeft corner doesn't change
cbSize.right, Height, // existing width, new height
SWP_NOMOVE | SWP_NOZORDER // don't move box or change z-ordering.
);
}
To change the size in Developer Studio, click on the drop-down arrow.
Notice the extremely subtle change (the highlighted grab handles move
from the left/right to top/bottom) and resize the combo.
--
Katy Mulvey k...@ormec.com
Software Development Engineer
ORMEC Systems http://www.ormec.com
--
James
---
www.catch22.net
Free win32 software, sourcecode and tutorials
-----
Please de-spam my email address before replying.
"scs0" <sc...@vol.com> wrote in message
news:1102715030.5...@z14g2000cwz.googlegroups.com...
I had to go to Google Groups to find out what you're talking about
(http://groups-beta.google.com/group/comp.os.ms-windows.programmer.win32/browse_thread/thread/d117157bd104400b?safe=images&as_umsgid=1102715030.5...@z14g2000cwz.googlegroups.com&lr=&hl=en),
but the method explained in the original thread is the real way: when
creating the combo box, the height you give you CreateWindow determines
the height of the list box.
--
Tim Robinson (MVP, Windows SDK)
http://mobius.sourceforge.net/