Search Results

Search found 5 results on 1 pages for 'ccombobox'.

Page 1/1 | 1 

  • Custom dropdown for CComboBox

    - by WalderFrey
    I'm trying to create a custom dropdown for a derivative of CComboBox. The dropdown will be a calendar control plus some 'hotspots', e.g. So I figure the best way to achieve this is to have a simple CWnd-derived class which acts as the parent to the calendar control, and have it paint the hotspots itself. The window needs to be a popup window - I think - rather than a child window so that it isn't clipped. But doing this causes the dialog (on which the combobox control is placed) to stop being the topmost (foreground?) window, leading to its frame being drawn differently: This spoils the illusion that the dropdown is part of the combobox since its acting more like a modal dialog at this point. Any suggestions on how I make the custom dropdown behave like the regular dropdown? Are there any other pitfalls I need to watch out for, e.g. focus and mouse capture issues?

    Read the article

  • C++ MFC add combo box string item from a widget ID

    - by OzBarry
    I've added a combo box in the gui editor in MSVC 2010 pro in my MFC project. I have a list of strings I am grabbing from an external source and want to add them to my combo box. I've searched for a while, and every post seems to suggest I need to use the CComboBox class, however, I have no idea how to get the class variable from the resource ID of the combobox element in the gui editor. In summary, how do I add a string to my combo box, either using a macro (like CB_ADDSTRING(RESOURCE_ID, "my string");) or using CComboBOx (something like CComboBox::GetObject(RESOURCE_ID)->AddString("blah");). I do not do much win32 api/mfc programming, and just started fiddling around with it.

    Read the article

  • [MFC] What is the reciprocal of CComboBox.GetItemData?

    - by Hamish Grubijan
    Instead of associating objects with Combo Box items, I associate long ids representing choices. They come from a database, so it seems natural to do so anyway. Now, I persist the id and not the index of the user's selection, so that the choice is remembered across sessions. If id no longer exists in database - no big deal. The choice will be messed up once. If db does not change, however, then it would be a great success ;) Here is how I get the id : chosenSomethingIndex = cmbSomething.GetCurSel(); lastSomethingId = cmbSomething.GetItemData(chosenSomethingIndex); How do I reverse this? When I load the stored value for user's last choice, I need to convert that id into an index. I can do: cmbSomething.SetCurSel(chosenSomethingIndex); However, how can I attempt (it might not exist) to get an index once I have an id? I am looking for a reciprocal function to GetItemData I am using VS2008, probably latest version of MFC, whatever that is. Thank you.

    Read the article

1