Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit u_form;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, u_combobox_sidecool, StdCtrls, ExtCtrls;
- type
- TForm1 = class(TForm)
- ComboBox1: TComboBox;
- LabeledEdit1: TLabeledEdit;
- LabeledEdit2: TLabeledEdit;
- LabeledEdit3: TLabeledEdit;
- procedure FormCreate(Sender: TObject);
- procedure ComboBox1Change(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.dfm}
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- AddItemComboBox(ComboBox1, '-- PILIH ITEM --', '-');
- AddItemComboBox(ComboBox1, 'Combobox Item 1', 'KODE1');
- AddItemComboBox(ComboBox1, 'Combobox Item 2', 'KODE2');
- AddItemComboBox(ComboBox1, 'Combobox Item 3', 'KODE3');
- AddItemComboBox(ComboBox1, 'Combobox Item 4', 'KODE4');
- AddItemComboBox(ComboBox1, 'Combobox Item 5', 'KODE5');
- AddItemComboBox(ComboBox1, 'Combobox Item 6', 'KODE6');
- AddItemComboBox(ComboBox1, 'Combobox Item 7', 'KODE7');
- ComboBox1.ItemIndex := 0;
- end;
- procedure TForm1.ComboBox1Change(Sender: TObject);
- begin
- LabeledEdit1.Text := getComboBoxKode(ComboBox1);
- LabeledEdit2.Text := getComboBoxText(ComboBox1);
- LabeledEdit3.Text := IntToStr(getComboBoxIndex(ComboBox1, getComboBoxKode(ComboBox1)));
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment