الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

Combo Box help

مغلق
بدأه theAviator6699 في 1 أبريل 2006 · 2 رد · 745 مشاهدة · في لغة C و ++C
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

Al Salamo 3alakom

I'm trying to get the index of the items in the combo box ,as follows

void CBarCodeDlg::OnSelchangeCombo1()

{

// TODO: Add your control notification handler code here

CString index;

index=m_cmbTest.GetCurSel();

m_strNoCopies=index;

UpdateData(FALSE);

}

m_cmbTest is the controller to the combo box

m_strNoCopies is ordinary text box

but all it returns is unknown letters,

thanks a lot

#2

the line

 index=m_cmbTest.GetCurSel();

returns the index of the curruntly selected item in the combobox not the actual item, and you should change index from CString type to int and create another CString variable say "str"

so another line is needed to get the actual text in the combobox class

m_cmbTest.GetLBText(index,str);

full code :-

void CShitDlg::OnSelchangeCombo2() 
{
int index;
CString str;
index=m_cmbTest.GetCurSel();
m_cmbTest.GetLBText(index,str);
m_strNoCopies=str;
UpdateData(FALSE);	
}
#3

Jazak Allah Khair...

هذا الموضوع مغلق.

مواضيع مشابهة