Click here to Skip to main content
16,010,553 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Clearing the edit box in ccombobox Pin
lctrncs29-Sep-06 5:44
lctrncs29-Sep-06 5:44 
GeneralRe: Clearing the edit box in ccombobox Pin
Zac Howland29-Sep-06 3:40
Zac Howland29-Sep-06 3:40 
GeneralRe: Clearing the edit box in ccombobox Pin
lctrncs29-Sep-06 5:19
lctrncs29-Sep-06 5:19 
QuestionRe: Clearing the edit box in ccombobox Pin
David Crow29-Sep-06 5:59
David Crow29-Sep-06 5:59 
AnswerRe: Clearing the edit box in ccombobox Pin
lctrncs29-Sep-06 6:31
lctrncs29-Sep-06 6:31 
QuestionRe: Clearing the edit box in ccombobox Pin
David Crow29-Sep-06 6:02
David Crow29-Sep-06 6:02 
AnswerRe: Clearing the edit box in ccombobox Pin
lctrncs29-Sep-06 6:49
lctrncs29-Sep-06 6:49 
GeneralRe: Clearing the edit box in ccombobox Pin
David Crow29-Sep-06 7:14
David Crow29-Sep-06 7:14 
Ok, what I have here may help, or it may not since it is not entirely like what you have. I have a CRecordset-derived class that reads from the Employees table of the Northwind database. I have a dialog with a combobox (having the CBS_DROPDOWNLIST style) and listbox. Selecting an item from the combobox will add it to the listbox. The selection in the combobox is then cleared.

BOOL CMyDlg::OnInitDialog()
{
    CDialog::OnInitDialog();
 
    CDatabase db;
    CSet rs(&db);
 
    rs.Open();
    while (! rs.IsEOF())
    {
        m_combo.AddString(rs.m_LastName);
        rs.MoveNext();
    }
 
    rs.Close();
 
    m_combo.InsertString(0, "");
     
    return TRUE;  // return TRUE  unless you set the focus to a control
}
 
void CMyDlg::OnSelchangeCombo1() 
{
    int nIndex = m_combo.GetCurSel();	
    CString strItem;
    m_combo.GetLBText(nIndex, strItem);
    m_list.AddString(strItem);
 
    m_combo.SetCurSel(0);
}
Is this close?





"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

"Judge not by the eye but by the heart." - Native American Proverb


GeneralRe: Clearing the edit box in ccombobox Pin
lctrncs29-Sep-06 11:20
lctrncs29-Sep-06 11:20 
GeneralRe: Clearing the edit box in ccombobox Pin
David Crow2-Oct-06 2:44
David Crow2-Oct-06 2:44 
GeneralRe: Clearing the edit box in ccombobox Pin
lctrncs2-Oct-06 5:13
lctrncs2-Oct-06 5:13 
QuestionRe: Clearing the edit box in ccombobox Pin
David Crow2-Oct-06 6:07
David Crow2-Oct-06 6:07 
GeneralRe: Clearing the edit box in ccombobox Pin
lctrncs29-Sep-06 5:43
lctrncs29-Sep-06 5:43 
QuestionRe: Clearing the edit box in ccombobox Pin
David Crow29-Sep-06 5:57
David Crow29-Sep-06 5:57 
AnswerRe: Clearing the edit box in ccombobox Pin
lctrncs29-Sep-06 6:10
lctrncs29-Sep-06 6:10 
QuestionRe: Clearing the edit box in ccombobox Pin
David Crow29-Sep-06 6:20
David Crow29-Sep-06 6:20 
AnswerRe: Clearing the edit box in ccombobox Pin
lctrncs29-Sep-06 6:40
lctrncs29-Sep-06 6:40 
GeneralRe: Clearing the edit box in ccombobox Pin
David Crow29-Sep-06 6:49
David Crow29-Sep-06 6:49 
GeneralRe: Clearing the edit box in ccombobox Pin
lctrncs29-Sep-06 8:42
lctrncs29-Sep-06 8:42 
GeneralRe: Clearing the edit box in ccombobox Pin
David Crow29-Sep-06 8:55
David Crow29-Sep-06 8:55 
GeneralRe: Clearing the edit box in ccombobox Pin
lctrncs29-Sep-06 10:48
lctrncs29-Sep-06 10:48 
GeneralRe: Clearing the edit box in ccombobox Pin
David Crow29-Sep-06 10:55
David Crow29-Sep-06 10:55 
Questiongraphing app help Pin
sys0p27-Sep-06 8:33
sys0p27-Sep-06 8:33 
AnswerRe: graphing app help Pin
Reagan Conservative27-Sep-06 8:46
Reagan Conservative27-Sep-06 8:46 
QuestionHDC coordinate space Pin
anthonym727-Sep-06 6:55
anthonym727-Sep-06 6:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.