2uzhan.com
Advertisement
Now Place:2uzhan.com » Programatically create and fill ComboBoxes

Programatically create and fill ComboBoxes

Software Development @ April 17, 2007   Views:0

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"

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 | [B]WS_VISIBLE[/B] | 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;
     }
...
...

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..."

--------------Solutions-------------

you might submit this in the C code snippets board :)

Write a java program that asks a person for his height (in meters) and weight (in kilograms) and
outputs one of the messages: underweight, normal, or obese, using the BMI ...

I'm attempting to simplify my fundraising page, and would like to show exactly how much each donation would help us out. I've listed the options below, but I would like ...

Before I get into the specific issues, I want to provide some other details:

  • Normally, I work on a live, paid server (even in dev); I realize that is ...
Tags:
© 2018 2uzhan.com Contact