Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Save or delete item in editable combobox
#1
Hi,

I need to save or delete entries in editable combobox controls. I have seen similar controls in many software. How can I implement them in QM? The following code only implements some functions 
Current problem: I can't get the text in the edit box at the same time, save and reload the items
[Image: 1678011956]
 
Thanks in advance for any suggestions and help
david

Macro Macro8
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;3 ComboBox 0x54230242 0x0 16 8 144 213 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040C02 "*" "" "" ""

str controls = "3"
str cb3
cb3=
;AAA
;BBB
;Save the current value to the list
;Delete the current list item
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case CBN_SELENDOK<<16|3
,_i=CB_SelectedItem(lParam)
,CB_GetItemText(lParam _i _s)
,int n=CB_GetCount(lParam)
,if _i=n-1 ;;Dele
,,mes "Line -1"
,,mes _s
,if _i=n-2 ;;Save
,,mes "Line -2"
,,mes _s
ret 1


Messages In This Thread
Save or delete item in editable combobox - by Davider - 03-02-2023, 10:21 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)