Mesela şöyle bir mantık olur mu? Runtime create yapsak nasıl olur?
Şöyle bir kod yaptım; sql kuralına uyan 5 tane buton açması ve butonların onclik eventlarına eylem atamam lazım :S
Şöyle bir kod yaptım; sql kuralına uyan 5 tane buton açması ve butonların onclik eventlarına eylem atamam lazım :S
procedure TForm1.FormCreate(Sender: TObject); var C: TButton; i:integer; Product:String; Adet,Cost:Integer; begin with Form1.MyQueryKategori do begin Close; SQL.Clear; SQL.Add('select * from TABLE_CATEGORY where SHOW_MAIN =: DefUserId'); ParamByName('DefUserId').AsInteger := 1; OPEN; i:=1; while NOT(MyQueryKategori.EOF) do begin C := TButton.Create(nil); C.Caption:= MyQueryKategoriCatname.AsString; C.Left:= 50; C.Top:= 10 ; C.Height:= 100; C.Width:= 100; C.Parent:=Self; Inc(i); MyQueryKategori.Next; end; Close; end; end;