SlideShare a Scribd company logo
1 of 15
ELC
void CELCDlg::OnBnClickedButton1()
{
// TODO: Add your control notification handler code here
CEdit* pe = (CEdit*)GetDlgItem(IDC_EDIT1);
CListBox* plb = (CListBox*)GetDlgItem(IDC_LIST1);
CString str;
pe->GetWindowText(str);
plb->AddString(str);
}
void CELCDlg::OnBnClickedButton2()
{
// TODO: Add your control notification handler code here
CComboBox* pcb = (CComboBox*)GetDlgItem(IDC_COMBO1);
CListBox* plb = (CListBox*)GetDlgItem(IDC_LIST1);
CString str;
int sel = plb->GetCurSel();
if (sel != CB_ERR) {
plb->GetText(sel, str);
pcb->AddString(str);
}
else
MessageBox(_T("Nu ati selectat nimic!"),_T("Message"));
}
void CELCDlg::OnBnClickedButton3()
{
// TODO: Add your control notification handler code here
CComboBox* pcb = (CComboBox*)GetDlgItem(IDC_COMBO1);
CListBox* plb = (CListBox*)GetDlgItem(IDC_LIST1);
CString str;
for (int i = 0; i < plb->GetCount(); i++) {
plb->GetText(i, str);
pcb->AddString(str);
}
}
MFC ELC

More Related Content

What's hot (14)

Tugas kelompok 3.2
Tugas kelompok 3.2Tugas kelompok 3.2
Tugas kelompok 3.2
 
All set1
All set1All set1
All set1
 
Tgs ppt alpro no.3
Tgs ppt alpro no.3Tgs ppt alpro no.3
Tgs ppt alpro no.3
 
Kelompok 2.6
Kelompok 2.6Kelompok 2.6
Kelompok 2.6
 
Code Snippet
Code SnippetCode Snippet
Code Snippet
 
MFC Text app
MFC Text appMFC Text app
MFC Text app
 
latihan SAP
latihan SAPlatihan SAP
latihan SAP
 
Teknik simulasi
Teknik simulasiTeknik simulasi
Teknik simulasi
 
Object Oriented Programing - Generic Programing
Object Oriented Programing - Generic ProgramingObject Oriented Programing - Generic Programing
Object Oriented Programing - Generic Programing
 
Código Arduino
Código ArduinoCódigo Arduino
Código Arduino
 
Kruskal algorithm
Kruskal algorithmKruskal algorithm
Kruskal algorithm
 
contoh Program C++ tentang fungsi for
contoh Program C++ tentang fungsi forcontoh Program C++ tentang fungsi for
contoh Program C++ tentang fungsi for
 
Program using function overloading
Program using function overloadingProgram using function overloading
Program using function overloading
 
MFC Message
MFC MessageMFC Message
MFC Message
 

More from Razvan Raducanu, PhD

More from Razvan Raducanu, PhD (20)

12. edit record
12. edit record12. edit record
12. edit record
 
11. delete record
11. delete record11. delete record
11. delete record
 
10. view one record
10. view one record10. view one record
10. view one record
 
9. add new record
9. add new record9. add new record
9. add new record
 
8. vederea inregistrarilor
8. vederea inregistrarilor8. vederea inregistrarilor
8. vederea inregistrarilor
 
7. copy1
7. copy17. copy1
7. copy1
 
6. hello popescu 2
6. hello popescu 26. hello popescu 2
6. hello popescu 2
 
5. hello popescu
5. hello popescu5. hello popescu
5. hello popescu
 
4. forme in zend framework 3
4. forme in zend framework 34. forme in zend framework 3
4. forme in zend framework 3
 
3. trimiterea datelor la vederi
3. trimiterea datelor la vederi3. trimiterea datelor la vederi
3. trimiterea datelor la vederi
 
2.routing in zend framework 3
2.routing in zend framework 32.routing in zend framework 3
2.routing in zend framework 3
 
1. zend framework intro
1. zend framework intro1. zend framework intro
1. zend framework intro
 
18. images in symfony 4
18. images in symfony 418. images in symfony 4
18. images in symfony 4
 
17. delete data
17. delete data17. delete data
17. delete data
 
16. edit data
16. edit data16. edit data
16. edit data
 
15. view single data
15. view single data15. view single data
15. view single data
 
14. add data in symfony4
14. add data in symfony4 14. add data in symfony4
14. add data in symfony4
 
13. view data
13. view data13. view data
13. view data
 
12.doctrine view data
12.doctrine view data12.doctrine view data
12.doctrine view data
 
11. move in Symfony 4
11. move in Symfony 411. move in Symfony 4
11. move in Symfony 4
 

MFC ELC

  • 1. ELC
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. void CELCDlg::OnBnClickedButton1() { // TODO: Add your control notification handler code here CEdit* pe = (CEdit*)GetDlgItem(IDC_EDIT1); CListBox* plb = (CListBox*)GetDlgItem(IDC_LIST1); CString str; pe->GetWindowText(str); plb->AddString(str); }
  • 9.
  • 10.
  • 11. void CELCDlg::OnBnClickedButton2() { // TODO: Add your control notification handler code here CComboBox* pcb = (CComboBox*)GetDlgItem(IDC_COMBO1); CListBox* plb = (CListBox*)GetDlgItem(IDC_LIST1); CString str; int sel = plb->GetCurSel(); if (sel != CB_ERR) { plb->GetText(sel, str); pcb->AddString(str); } else MessageBox(_T("Nu ati selectat nimic!"),_T("Message")); }
  • 12.
  • 13.
  • 14. void CELCDlg::OnBnClickedButton3() { // TODO: Add your control notification handler code here CComboBox* pcb = (CComboBox*)GetDlgItem(IDC_COMBO1); CListBox* plb = (CListBox*)GetDlgItem(IDC_LIST1); CString str; for (int i = 0; i < plb->GetCount(); i++) { plb->GetText(i, str); pcb->AddString(str); } }