Topic: Using Combobox items as buttons.
I'm trying to use combobox items as buttons except the first combo item. I like to use first combo item as combo caption. Combobox is on main form (form1)
Combo items:
Print
Print Selected
Print All
First empty item unchecked (false) on combo properties.
Buttons part seems to be OK but getting first combo item displayed as combo caption on form1 show is not?
procedure Form1_OnShow (Sender: string; Action: string);
begin
Form1.ComboBox1.Clear;
Form1.ComboBox1.Items.Add('Print');
Form1.ComboBox1.Items.Add('Print All');
Form1.ComboBox1.Items.Add('Print Selected');
Form1.ComboBox1.Text := 'Print';
Form1.edCombo1Value.Text := 'Print';
end;
procedure Form1_ComboBox1_OnChange (Sender: string);
begin
Form1.edCombo1Value.Text := Form1.ComboBox1.Text;
if Form1.ComboBox1.Text = 'Print All' then Form1.Button2.Click;
if Form1.ComboBox1.Text = 'Print Selected' then Form1.Button3.Click;
end;
Please see the attached sample project below if needed.
God... please help me become the person my dog thinks I am.