Senin, 12 Maret 2012

Progran_01

  1. kombobox1>>procedure TForm1.ComboBox1Change(Sender: TObject);
                           begin
                           if ComboBox1.ItemIndex=0 then
                           Edit2.Text:='500000'
                          else if ComboBox1.ItemIndex=1 then
                          Edit2.Text:='600000';
                          if ComboBox1.ItemIndex=2 then
                          Edit2.Text:='700000'
                          end; 
  2. checkbox1>>procedure TForm1.CheckBox1Click(Sender: TObject);
                         begin
                         if checkbox1.Checked then
                        edit3.Text:='50000'
                        end; 
  3. checkbox2>>procedure TForm1.CheckBox2Click(Sender: TObject);
                         begin
                         if checkbox2.Checked then
                         edit4.Text:='10000'
                         end;
  4. RadioButton1>>procedure TForm1.RadioButton1Click(Sender: TObject);
                              begin
                              if radiobutton1.Checked then
                              edit5.Text:='0';
                              end;
  5. RadioButton2>>procedure TForm1.RadioButton2Click(Sender: TObject);
                             begin
                             if radiobutton2.Checked then
                            edit5.text:='5000'
                            end;
  6. Hitung>>procedure TForm1.Button1Click(Sender: TObject);
                  var
                  a,b,c,d,e:integer;
                  begin
                  a:=strToInt(Edit2.Text);
                  b:=strToInt(Edit3.Text);
                  c:=strToInt(Edit4.Text);
                  d:=strToInt(Edit5.Text);
                  e:=a+b+c+d;
                  edit6.Text:=inttostr(e);
                  end;
  7. Hapus>> procedure TForm1.Button2Click(Sender: TObject);
                   begin
                   edit1.Text:='';
                   combobox1.Text:='';
                   edit2.Text:='';
                   edit3.Text:='';
                   edit4.Text:='';
                   edit5.Text:='';
                   edit6.Text:='';
                   edit1.setfocus;
                   end;
  8. Keliar>> ShowMessage('apakah anda yakin mau keluar');
                  application.Terminate;

Tidak ada komentar:

Posting Komentar