form assing parent window or control lazarus / 21-General ---------------------------------------------------------------------- eldonfsr · 2021-08-23 00:57 Hello I some confuse because i form and come controls on that my dude is 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    if not Assigned(FormSelParts) then begin       Application.CreateForm(TFormSelParts, FormSelParts);    end;    FormSelParts.Top      := FormMain.Top+ FormRFqInf.Top + Panel2.Top+DBGDetPo.SelectedFieldRect.Top+30 ;    FormSelParts.Left   := Formmain.Left+FormRFqInf.Left+ EbPart.Left+DbgDetPo.Left+EBPart.Width;    FormSelParts.FOrigin  :=FormRfqInf ;    formSelParts.CtrlOrig := EBPart;    FormSelParts.show;  with code i can active the form and select register from dbgrid. ans close form and focust on control 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 TFormSelParts.DBGPartsDblClick(Sender: TObject);begin   CtrlOrig.Text := SQLQParts.FieldByName('pnpartnumber').AsString;   CtrlOrig.setfocus ;   FormSelParts.Close;end; but just i assing form.Parent  all woing wrong i can assign the text but no focus control again. 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  if not Assigned(FormSelParts) then begin       Application.CreateForm(TFormSelParts, FormSelParts);    end;    FormSelParts.Top      := FormMain.Top+ FormRFqInf.Top + Panel2.Top+DBGDetPo.SelectedFieldRect.Top+30 ;    FormSelParts.Left   := Formmain.Left+FormRFqInf.Left+ EbPart.Left+DbgDetPo.Left+EBPart.Width;    FormSelParts.Parent   := FormRfqInf;    FormSelParts.FOrigin  :=FormRfqInf ;    formSelParts.CtrlOrig := EBPart;    FormSelParts.show;  this only diferent  FormSelParts.Parent   := FormRfqInf; when i ejecute this part send me error like invisible control   CtrlOrig.setfocus ; i tried to undertand was is going but i dotn get understand... please help me is mor easy it can assing parent because to assing location us more clear and simple. thanks Enrique ---------------------------------------------------------------------- ASerge · 2021-08-23 06:08 Quote from: eldonfsr on August 23, 2021, 02:57:19 amwhen i ejecute this part send me error like invisible control   CtrlOrig.setfocus ; FormSelParts.ActiveControl := CtrlOrig; ---------------------------------------------------------------------- eldonfsr · 2021-08-23 18:55 Here app with test , if delete this line work  FormSelPart.Parent   := Formmain;    but with that line active... also when close form and back to previous the focus going to the first control