Arsip: Cara menambahkan komponent edit
more 14 years ago
de27de
halo master delphi mohon bantuan nya plz
aku mau buat inputan yang component edit nya bisa ditambahkan
secara otomatis di form
contoh
barang 1
barang 2
barang 3
barang 4
barang 5
button ( + )button (-)
yang pertama muncul barang 1
nah pas di klik button (+) inputan barang 2 muncul
klik button (+) lagi inputan baranag 3 muncul
klik button(+)lagi inputan barang 4 mucul
gmn master coding buat menambahkan komponent edit aku coba 2 inputan berhasil tpi kalo datanya itu lebih dari 2 gmn cara nya menampilkan component edit /inputan mohon pencerahan nya
more 14 years ago
de27de
coding masih simple
edit2.show;
untuk button (+)untuk button(-)
edit2.hide;
baru kaya gitu
more 14 years ago
de27de
looping komponet aku ga tau kk gmn cara nya kalo char selain menggunakan komponent bis
more 14 years ago
mas_kofa
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
btnPlus: TButton;
btnMinus: TButton;
procedure FormCreate(Sender: TObject);
procedure btnPlusClick(Sender: TObject);
procedure btnMinusClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
EditSet : array of TEdit ;
idx: integer;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
//set edit1..edit5 invisible;
idx := 0;
EditSet[1] := Edit1;
EditSet[2] := Edit2;
EditSet[3] := Edit3;
EditSet[4] := Edit4;
EditSet[5] := Edit5;
end;
procedure TForm1.btnPlusClick(Sender: TObject);
begin
inc(idx);
if idx > 5 then
begin
idx := 6;
exit;
end;
EditSet[idx].Visible := true;
end;
procedure TForm1.btnMinusClick(Sender: TObject);
begin
dec(idx);
if idx < 1 then
begin
idx := 0;
exit;
end;
EditSet[idx].Visible := false;
end;
end.
more 14 years ago
mas_kofa
NB :
if idx > 5 then --> if idx > 5 then
if idx < 1 then --> if idx < 1 then
more ...
- Pages:
- 1
reply |
Report Obsolete
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 3 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 3 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 4 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 11 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 11 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 11 years ago
Random Topic
- Yang baru sejak Delphi 7
by deLogic in Tip n Trik Pemrograman more 17 years ago - import data XML
by delphi1st in Tip n Trik Pemrograman more 17 years ago - tanya...finger print digital persona
by batozai in Network, Files, I/O & System more 14 years ago - [tanya] data dbgrid ke new table
by jayadi888 in MySQL more 18 years ago - kompo D3vExpr3ess
by Akuna-Matata in MySQL more 17 years ago - Cara mudah untuk Memasukkan TIMage ke Array?
by ivan in Hal umum tentang Pascal Indonesia more 16 years ago - [Ask] Free DLL Handle
by henry_sys in OOT more 12 years ago - About Printer
by krishy in Tip n Trik Pemrograman more 16 years ago - How to make appearance smootly?
by johnizzy in Form Enhancement & Graphical Controls more 15 years ago - Konsep ChaceUpdate di ZQuery ZEOS
by onsir in MySQL more 16 years ago