artem_niko Posted March 19, 2023 Share Posted March 19, 2023 Good afternoon! I'm interested in this. Is it possible to make it so that UniForm could be made as a separate window, but without breaking away from MainForm? Let me explain what I mean. Here in your browser there are tabs, and let's say you have connected a second monitor to your computer and want to display some tab, for example, from YouTube, on the second monitor. To do this, you just take the tab title and drag it to the second monitor and it works. Here, I need to be able to do this with the form. Is this possible? I tried the UniMainModule.ConstrainForms, but it only turns out that I can move the form within the MainForm of the main project, and I would need to move the form outside of it. Quote Link to comment Share on other sites More sharing options...
FXSystems Posted March 19, 2023 Share Posted March 19, 2023 I do not know if this solution will ultimately be for you, but I solve a similar problem by running uniForm as pages in uniPageControl. procedure TMainForm.RunTheFormAsPage(form_caption: string); var Ts : TUniTabSheet; isShow : Boolean; i: Integer; begin isShow:=False; if uniPageControl.PageCount>0 then Begin for i := 0 to uniPageControl.PageCount-1 do Begin if uniPageControl.Pages[i].Caption = form_caption then Begin isShow:=True; uniPageControl.ActivePage:=uniPageControl.Pages[i]; End; End; End; if isShow=False then Begin Ts := TUniTabSheet.Create(Self); Ts.PageControl := uniPageControl; Ts.Closable := True; Ts.Layout := 'fit'; Ts.Caption := form_caption; Ts.AlignmentControl := uniAlignmentClient; uniForm.Parent:=Ts; uniForm.Show(); End; end; It is also useful to remove border for this attached form. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.