dotted rectangle is not being cleared if any empty string added in MFC comboboc
-
Hi Freinds, I have combobox control in my mfc application. Here I am adding an item with an empty string and 2 more item with some txt. if i am navigating through the items, if empty string get selected, it draws a dotted boundary, but when other item is getting selected, dotted boundary of empty string is not getting cleared. So basically I can see 2 items selected at the same time. please help me out. Regards, Amrit
-
Hi Freinds, I have combobox control in my mfc application. Here I am adding an item with an empty string and 2 more item with some txt. if i am navigating through the items, if empty string get selected, it draws a dotted boundary, but when other item is getting selected, dotted boundary of empty string is not getting cleared. So basically I can see 2 items selected at the same time. please help me out. Regards, Amrit
You could just intercept the DrawItem call and for any empty string simply clear the lpDrawItemStruct->rcRect manually and then pass all the calls thru to the normal drawitem. lpDrawItemStruct has everything you need to know what to draw lpDrawItemStruct->itemID it the string number lpDrawItemStruct->itemState & ODS_SELECTED will tell give you if it is selected or not. lpDrawItemStruct->rcRect is the area to draw in
In vino veritas