int MainWindow::OnCreate(CREATESTRUCT* pcs) { Edit edit; edit.Create(* this,WS_CHILD | WS_VISIBLE | WS_BORDER,"",IDC_EDIT,120,10,100,24 ); Button button_add; button_add.Create(* this,WS_CHILD | WS_VISIBLE,"add",IDC_ADD,120,40,100,24); Button button_remove; button_remove.Create(* this,WS_CHILD | WS_VISIBLE,"remove",IDC_REMOVE,120,70,100,24); ListBox listbox; listbox.Create(* this,WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL,"listbox",IDC_LB,10,10,100,100); EnableWindow(GetDlgItem(*this,IDC_REMOVE),false); // TODO: create all child windows // TODO: disable "Remove" button return 0; }
int MainWindow::OnCreate(CREATESTRUCT* pcs) { // TODO: create all child windows ListBox listbox; listbox.Create(*this, WS_CHILD | WS_VISIBLE | WS_BORDER , "", IDC_LB, 10, 10, 180, 150); Edit edit; edit.Create(*this, WS_CHILD | WS_VISIBLE | WS_BORDER, "", IDC_EDIT, 202, 10, 150, 40); Button button_add; button_add.Create(*this, WS_CHILD | WS_VISIBLE | WS_BORDER ,"Add", IDC_ADD, 202, 60, 150, 40); Button button_remove; button_remove.Create(*this, WS_CHILD | WS_VISIBLE | WS_BORDER, "Remove", IDC_REMOVE, 202, 110, 150, 40); // TODO: disable "Remove" button EnableWindow(GetDlgItem(*this, IDC_REMOVE), false); //disable "Add" button until something is written in edit EnableWindow(GetDlgItem(*this, IDC_ADD), false); return 0; }
int MainWindow::OnCreate(CREATESTRUCT* pcs) { //texstbox edit.Create(*this, WS_CHILD | WS_VISIBLE | WS_BORDER, "", IDC_EDIT, 220, 10, 150, 50); char s[128]; //Kreirai buttoni LoadString(0, IDS_Add, s, sizeof s); button.Create(*this, WS_CHILD | WS_VISIBLE | WS_BORDER, s, IDC_ADD, 220, 70, 150, 50); LoadString(0, IDS_Remove, s, sizeof s); button.Create(*this, WS_CHILD | WS_VISIBLE | WS_DISABLED, s, IDC_REMOVE, 220, 130, 150, 50); //Listbox listBox.Create(*this, WS_CHILD | WS_VISIBLE | WS_BORDER, "", IDC_LB, 10, 10, 200, 300); return 0; }