How to make record (string/int/value) data mysql into caption TLabel/TButton lazarus / 61-Beginners ---------------------------------------------------------------------- om.ndoet · 2017-02-21 00:25 Hi i am Indonesian, sorry about my English first... it s bad. I am beginner in programming.. First, i have problem to make a dinamicly TButton into form (but i have idea to solve this) Second, i would to make a caption TButton from record data mysql (use zeos) ex. First record on scond field, scond  record on scond field... anyone can help me? To give me example code? Thanks before... ---------------------------------------------------------------------- howardpc · 2017-02-21 04:01 First question: unzip and try the attached project. Second question: I'm not clear what you are asking. ---------------------------------------------------------------------- om.ndoet · 2017-02-21 04:49 i would to insert caption TLabel with a value data ex. procedure TMainForm.FormCreate(Sender: TObject); begin   BitBtn1.Caption:=ZQuery1.RecNo.....???? // end; so i want to insert caption button dynamicly from database... thanks before... ---------------------------------------------------------------------- miab3 · 2017-02-21 22:07 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var j:integer;    btn:TButton;beginZQuery1.First;for j:=1 to 10 do    begin    btn := (FindComponent('Button'+IntToStr(j)) as TButton);    btn.Caption := ZQuery1.Fields[1].AsString;    ZQuery1.Next;    end;end;  Michal ---------------------------------------------------------------------- howardpc · 2017-02-21 22:42 Or if your dataset is called MyDataset with a string field called ButtonCaptions, and the dynamic button is a field FButton on your form you could add an OnAfterScroll event for the dataset like this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.MyDatasetAfterScroll(DataSet: TDataSet);begin  if Assigned(FButton) then    FButton.Caption:=MyDataset.FieldByName('ButtonCaptions').AsString;end; Well, your dataset will probably be dropped on a datamodule, not on the form, but you get the idea. ---------------------------------------------------------------------- om.ndoet · 2017-02-22 02:10 Thanks all.. in fact, me use data modul to insert zeos component.. I will try later... ---------------------------------------------------------------------- om.ndoet · 2017-02-22 03:25 Quote from: howardpc on February 21, 2017, 05:01:11 amFirst question: unzip and try the attached project. Second question: I'm not clear what you are asking. DynamicButton.lpr(20,1) Error: Can't open resource file "\\published\DynamicButton.res" sorry  Quote from: miab3 on February 21, 2017, 11:07:40 pmCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var j:integer;    btn:TButton;beginZQuery1.First;for j:=1 to 10 do    begin    btn := (FindComponent('Button'+IntToStr(j)) as TButton);    btn.Caption := ZQuery1.Fields[1].AsString;    ZQuery1.Next;    end;end;  Michal i try, but found error 'External SIGSEGV' in dm.Query1.First; sorry ---------------------------------------------------------------------- jacmoe · 2017-02-22 03:43 Look at the code and use it in your own way in your own project ---------------------------------------------------------------------- miab3 · 2017-02-22 07:37 Probably missing: ZQuery1.Open; Michal ---------------------------------------------------------------------- om.ndoet · 2017-02-23 02:38 ok... thanks all...