| | |
Programatically create and fill ComboBoxes
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Mar 2007
Posts: 37
Reputation:
Solved Threads: 1
For those who want to learn about windows, I leave the code I was looking for...
"Programatically filling a ComboBox and setting it visible or invisible"
I would like to thank the ones who "made the effort to answer me"... even if it was only to tell me that they didn't know how to do it
"Sometimes is better to say I don't know..."
"Programatically filling a ComboBox and setting it visible or invisible"
HWND hWndComboBox[10];
char numChar[20]; // String that contains a number converted to string
int yPos = 160, xPos = 60;
int counter1, counter2; //
switch(Msg){
case WM_INITDIALOG:
for(counter1 = 0; counter1 < MAX_COMBOS; counter1++){
hWndComboBox[counter1] = CreateWindow("COMBOBOX", NULL, WS_CHILD | WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWN | WS_VSCROLL, xPos, yPos, 60, 60, hWndDlg, NULL, hInst, NULL);
if(!hWndComboBox){
MessageBox(hWndDlg, "Could not create the combo box", "Failed Control Creation", MB_OK);
return FALSE;
}
// I'll fill the ComboBoxes with numbers from 1 to LAST_NUMBER
for(counter2 = 1; counter2 <= LAST_NUMBER; counter2 ++){
itoa(counter2 , numChar, 10);
SendMessage(hWndComboBox[counter1], CB_ADDSTRING, 0, reinterpret_cast<LPARAM>((LPCTSTR)numChar));
}
}
return TRUE;
}
...
..."Sometimes is better to say I don't know..."
![]() |
Similar Threads
- Web banners in Photoshop (Graphics and Multimedia)
- Curve designs using HTML (HTML and CSS)
- How pass dynamic array into function? (C++)
- Automatic Shuffle Master (C++)
- database question (C#)
- sourcing a python config file? (Python)
- How to Open a word doc from a java application? (Java)
- reading a same input twice from the console (C)
Other Threads in the C Forum
- Previous Thread: developers forum..
- Next Thread: How to detect our session mode in Windows
| Thread Tools | Search this Thread |
adobe ansi api array arrays bash binarysearch centimeter char convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic fflush file floatingpointvalidation fork frequency getlasterror getlogicaldrivestrin givemetehcodez global graphics gtkgcurlcompiling hardware highest homework i/o ide inches infiniteloop initialization interest kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix meter microsoft motherboard multi mysql odf open opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer pointers posix power probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling segmentationfault send shape single socketprograming socketprogramming stack standard strchr string strings structures suggestions systemcall test testautomation unix urboc user voidmain() wab win32api windows.h






