I draw combobox on dialog. but when i execute my program & when i click on vertical scroll the combobox did not appear as drop down i set property visible=true, i make sort=true,vertical scroll = true,type= drop down , ownerdraw=no,
i insert following code in InitDialog()
but my program doesn't work properly, when i click on vertical scroll of combo it does not dropsdown, it it requires additonal code then please give me the complete procedure only to draw combobox on dialog
since i am new to VC++ struggling to build one ocx, in which your tips also useful to me to expand the width of the listbox.... can u just guide me what is that listwidth and from where to get the listwidth... etc.
...everywhere I do that, the width is always much wider than needed. I have heard a rumor that the DC used to finally draw the list box contents has a different font. Am I missing something between m_hDC and m_hAttribDC?
My combobox contains items whose names constantly change. (Every second, a time in name is updated.) The only technique available when I was using a plain combobox was to empty it and refill. That prevented the user from tracking the item they wanted because it ceased to exist in the combobox every second. This became really hard if the user had to scroll the list to get their item. We also need to change the sort order to match a numerical ID (Item 2 had to be before Item 10).
I tried to solve the problem by making the combobox owner drawn as a class derived from CComboBox. I overrode CompareItem to solve the sorting problem. I ensured that the name displayed was not looked up until DrawItem was painting that name. Next, I added a function that was called by the parent after the item names had changed which invalidated the combobox.
Unfortunately, that didn't affect the list box portion of the combobox (DROPLIST style). There seemed to be no way to retrieve a handle to the listbox under Windows 95 or Windows NT SP5 or older. I was ready to abandon the combobox altogether when I saw this article.
The article did not match what I needed, but it did help. The author used the combobox's OnCtlColor to access listbox's HWND. So, I memorized that and when the item names changed, I was able to invalidate the listbox. It is now working.