shidqul

contoh_u_form

Sep 4th, 2019
751
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.35 KB | None | 0 0
  1. unit u_form;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, u_combobox_sidecool, StdCtrls, ExtCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     ComboBox1: TComboBox;
  12.     LabeledEdit1: TLabeledEdit;
  13.     LabeledEdit2: TLabeledEdit;
  14.     LabeledEdit3: TLabeledEdit;
  15.     procedure FormCreate(Sender: TObject);
  16.     procedure ComboBox1Change(Sender: TObject);
  17.   private
  18.     { Private declarations }
  19.   public
  20.     { Public declarations }
  21.   end;
  22.  
  23. var
  24.   Form1: TForm1;
  25.  
  26. implementation
  27.  
  28. {$R *.dfm}
  29.  
  30. procedure TForm1.FormCreate(Sender: TObject);
  31. begin
  32.  AddItemComboBox(ComboBox1, '-- PILIH ITEM --', '-');
  33.  AddItemComboBox(ComboBox1, 'Combobox Item 1', 'KODE1');
  34.  AddItemComboBox(ComboBox1, 'Combobox Item 2', 'KODE2');
  35.  AddItemComboBox(ComboBox1, 'Combobox Item 3', 'KODE3');
  36.  AddItemComboBox(ComboBox1, 'Combobox Item 4', 'KODE4');
  37.  AddItemComboBox(ComboBox1, 'Combobox Item 5', 'KODE5');
  38.  AddItemComboBox(ComboBox1, 'Combobox Item 6', 'KODE6');
  39.  AddItemComboBox(ComboBox1, 'Combobox Item 7', 'KODE7');
  40.  
  41.  ComboBox1.ItemIndex := 0;
  42. end;
  43.  
  44. procedure TForm1.ComboBox1Change(Sender: TObject);
  45. begin
  46.  LabeledEdit1.Text := getComboBoxKode(ComboBox1);
  47.  LabeledEdit2.Text := getComboBoxText(ComboBox1);
  48.  LabeledEdit3.Text := IntToStr(getComboBoxIndex(ComboBox1, getComboBoxKode(ComboBox1)));
  49. end;
  50.  
  51. end.
Advertisement
Add Comment
Please, Sign In to add comment