How to use the combobox control ?
I'm trying but without success, using a similar code than for the listbox but...
Small diference with the other control is that the default value set in the visual form builder is not displayed on the pocket pc.
func ComboBoxAddItem(combobox$, editbox$)
text$ = GetText(editbox$);
SetItem(editbox$,0,text$);
where$ = SendMessage(combobox$, CB_GETCURSEL, where$, 0);
SendMessage(combobox$, CB_ADDSTRING, where$, text$);
Return(True);
end;
func ComboBoxDelItem(combobox$)
where$ = SendMessage(combobox$, CB_GETCURSEL, where$, 0);
SendMessage(combobox$, CB_DELETESTRING, where$, 0);
Return(True);
end;
func FORM100Proc (hWnd$, Msg$, wParam$, lParam$)
ok$ = true;
case(Msg$)
WM_COMMAND:
wmId$ = LOWORD(wParam$);
wmEvent$ = HIWORD(wParam$);
case(wmId$)
1001: // Exit
PostMessage(hWnd$, WM_CLOSE, 0, 0);
return(false);
103: // Add
ComboBoxAddItem(COMBOBOX101$,EDIT102$);
104: // Del
ComboBoxDelItem(COMBOBOX101$);
105: // Update
//ComboBoxUpdateItem(COMBOBOX101$,EDIT102$);
106: // Clear
//ComboBoxClear(COMBOBOX101$);
107: // Test
//ComboBoxTest(COMBOBOX101$);
end;
end;
return (ok$);
end;
I'm trying but without success, using a similar code than for the listbox but...
Small diference with the other control is that the default value set in the visual form builder is not displayed on the pocket pc.
func ComboBoxAddItem(combobox$, editbox$)
text$ = GetText(editbox$);
SetItem(editbox$,0,text$);
where$ = SendMessage(combobox$, CB_GETCURSEL, where$, 0);
SendMessage(combobox$, CB_ADDSTRING, where$, text$);
Return(True);
end;
func ComboBoxDelItem(combobox$)
where$ = SendMessage(combobox$, CB_GETCURSEL, where$, 0);
SendMessage(combobox$, CB_DELETESTRING, where$, 0);
Return(True);
end;
func FORM100Proc (hWnd$, Msg$, wParam$, lParam$)
ok$ = true;
case(Msg$)
WM_COMMAND:
wmId$ = LOWORD(wParam$);
wmEvent$ = HIWORD(wParam$);
case(wmId$)
1001: // Exit
PostMessage(hWnd$, WM_CLOSE, 0, 0);
return(false);
103: // Add
ComboBoxAddItem(COMBOBOX101$,EDIT102$);
104: // Del
ComboBoxDelItem(COMBOBOX101$);
105: // Update
//ComboBoxUpdateItem(COMBOBOX101$,EDIT102$);
106: // Clear
//ComboBoxClear(COMBOBOX101$);
107: // Test
//ComboBoxTest(COMBOBOX101$);
end;
end;
return (ok$);
end;