Topic: Hiding combobox items ?

How can I hide combobox items on a button click?

I have two forms
Form1 with Button1 and Button2
Form 2 has a combobox with Item1, Item2, Item3, Item4. Combobox items (data) added manually in SQLiteStudio.


If Button1 clicked
Show only combobox Item1 and Item 3
If Button2 clicked
Show only combobox Item1, Item 2 and Item4


I couldn't translate the above into MVD script that works?

Adam
God... please help me become the person my dog thinks I am.

Re: Hiding combobox items ?

Hi,
This way keeps the script small but I'm sure there are other approaches.
Derek.

Post's attachments

Attachment icon adam combobox items.zip 336.96 kb, 375 downloads since 2017-05-29 

Re: Hiding combobox items ?

Hi Derek,


Nice and neat solution... Thank you very much...... Truly appreciated......


Perhaps Dmitry can offer full script version within MVD only, just to have an alternative.

Adam
God... please help me become the person my dog thinks I am.

Re: Hiding combobox items ?

Another way

procedure Form1_Button2_OnClick (Sender: string; var Cancel: boolean);
begin
  form1.combobox1.dbfilter := 'id=1 or id=3';
  form1.combobox1.dbupdate;
end;

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
begin
  form1.combobox1.dbfilter := 'id=1 or id=2 or id=4';
  form1.combobox1.dbupdate;
end;
Dmitry.

Re: Hiding combobox items ?

Hi Dmitry,


Thank you very much......
Truly appreciated............

Adam
God... please help me become the person my dog thinks I am.