Drawing on a listview, combobox to big, and how do I create a flat CButton?
-
I'm trying to draw control programmatically in the 1st sub item of a listview row when the user sets the focus to that item. I have a handful of questions. Currently I'm doing this in the OnItemChanged and seeing if the items uNewState is SELECTED. Is this the best place to do this? Seems to work. Next, I use GetSubItemRect in combination with pNMLV-iItem to get the rect of the subitem I want to put the control over. This seem to work ok...except..with a combobox. GetListCtrl().GetSubItemRect(pNMLV->iItem,1,LVIR_BOUNDS,itemRect); CComboBox *pCombo = new CComboBox; pCombo->Create(WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | WS_CLIPCHILDREN, itemRect, this,190); The combobox shows up to big. It must have a minmum size or something? when I do the same thing with CEdit and CButton they work perfect. Also isn't the size difference in a combobox's CRect top and bottom the amount the combbox will drop down? Also, is there a way to create the combobox without a boarder so it will show up over the subitem better? Is there a style to make CButton flat? thanks mike
-
I'm trying to draw control programmatically in the 1st sub item of a listview row when the user sets the focus to that item. I have a handful of questions. Currently I'm doing this in the OnItemChanged and seeing if the items uNewState is SELECTED. Is this the best place to do this? Seems to work. Next, I use GetSubItemRect in combination with pNMLV-iItem to get the rect of the subitem I want to put the control over. This seem to work ok...except..with a combobox. GetListCtrl().GetSubItemRect(pNMLV->iItem,1,LVIR_BOUNDS,itemRect); CComboBox *pCombo = new CComboBox; pCombo->Create(WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | WS_CLIPCHILDREN, itemRect, this,190); The combobox shows up to big. It must have a minmum size or something? when I do the same thing with CEdit and CButton they work perfect. Also isn't the size difference in a combobox's CRect top and bottom the amount the combbox will drop down? Also, is there a way to create the combobox without a boarder so it will show up over the subitem better? Is there a style to make CButton flat? thanks mike
I believe you can make the buttons flat in the resource editor. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001