Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. procedure TPanel.Resize;
  2. begin
  3. inherited;
  4. ResizeForm();
  5. end;
  6.  
  7. procedure TPanel.ResizeForm;
  8. begin
  9. if Assigned(FForm) then
  10. Platform.SetWindowRect(FForm, RectF(BorderWidth, BorderWidth,
  11. ClientWidth + BorderWidth, ClientHeight + BorderWidth));
  12. end;
  13.  
  14. procedure TPanel.SetForm(const AForm: TCommonCustomForm);
  15. begin
  16. FForm := AForm;
  17. FForm.BorderIcons := [];
  18. FForm.BorderStyle := TFmxFormBorderStyle.bsNone;
  19. ResizeForm();
  20. FForm.Visible := True;
  21. Winapi.Windows.SetParent(FmxHandleToHWND(FForm.Handle), Handle);
  22. end;
  23.  
  24. procedure TForm25.Button1Click(Sender: TObject);
  25. var
  26. F: Unit26.TForm26;
  27. begin
  28. F := TForm26.Create(nil);
  29. try
  30. F.ShowModal;
  31. finally
  32. F.Free;
  33. end;
  34. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement