Topic: Hard Coded Combobox

The following script works with combo style Dropdown but combo style Dropdown List doesn't. "Showrecord" part fails, doesn't display the saved combo item.

procedure frmSaleInv_OnShow (Sender: TObject; Action: string);
begin
frmSaleInv.cbSIpaid.Clear;
frmSaleInv.cbSIpaid.Items.Add('Fully Paid');
frmSaleInv.cbSIpaid.Items.Add('Partially Paid');
frmSaleInv.cbSIpaid.Items.Add('Unpaid');

If frmSaleInv.dbAction = 'ShowRecord' then
   Begin
   frmSaleInv.cbSIpaid.Text := frmSaleInv.edSIpaidValue.Text;
   End;
end;

procedure frmSaleInv_cbSIpaid_OnChange (Sender: TObject);
begin
frmSaleInv.edSIpaidValue.Text := frmSaleInv.cbSIpaid.Text;
end;

♦ How can I make the script above works fully for combo style Dropdown List?
♦ Alternatively, is it possible to make combo style Dropdown read only?

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

Re: Hard Coded Combobox

Check it out

procedure frmSaleInv_OnShow (Sender: TObject; Action: string);
begin
    frmSaleInv.cbSIpaid.Clear;
    frmSaleInv.cbSIpaid.Items.Add('Fully Paid');
    frmSaleInv.cbSIpaid.Items.Add('Partially Paid');
    frmSaleInv.cbSIpaid.Items.Add('Unpaid');

    If frmSaleInv.dbAction = 'ShowRecord' then
    Begin
         frmSaleInv.cbSIpaid.ItemIndex :=  frmSaleInv.cbSIpaid.Items.IndexOf(frmSaleInvedSIpaidValue.Text);
    End;
end;
Dmitry.

Re: Hard Coded Combobox

Thank you very much Dmitry...........


Straight c/p didn't work. I realized dots were missing. When I added the dots where needed then it worked fine.
(frmSaleInv.edSIpaidValue.Text)


Once again thanks a lot for your kind help.

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