CCH4UNIGUI Posted February 19, 2021 Share Posted February 19, 2021 Hi In Delphi, its trivial to call another form via a menu, button etc via a click event. I have taken a look at the AllFeatures demo, mdemo but cannot understand nor see how this is done. Can anybody clarify. TQ Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 19, 2021 Share Posted February 19, 2021 2 minutes ago, CCH4UNIGUI said: In Delphi, its trivial to call another form via a menu, button etc via a click event. I have taken a look at the AllFeatures demo, mdemo but cannot understand nor see how this is done. Can anybody clarify. Hello, procedure TMainForm.NavTreeClick(Sender: TObject); var Nd : TUniTreeNode; Ts : TUniTabSheet; FrC : TUniFrameClass; Fr : TUniFrame; FClassName, Path: string; begin Path := UniServerModule.StartPath + 'units\'; Nd := NavTree.Selected; if Nd.Count = 0 then begin Ts := Nd.Data; if not Assigned(Ts) then begin Ts := TUniTabSheet.Create(Self); Ts.PageControl := UniPageControl1; Ts.Closable := True; Ts.OnClose := TabSheetClose; Ts.Tag := NativeInt(Nd); Ts.Caption := Nd.Text; Ts.ImageIndex := Nd.ImageIndex; FClassName := 'TUni' + FileNames.Values[Nd.Text]; FrC := TUniFrameClass(FindClass(FClassName)); Fr := FrC.Create(Self); Fr.Align := alClient; Fr.Parent := Ts; Nd.Data := Ts; end; UniPageControl1.ActivePage := Ts; end; end; ... Quote Link to comment Share on other sites More sharing options...
CCH4UNIGUI Posted February 19, 2021 Author Share Posted February 19, 2021 12 minutes ago, Sherzod said: Hello, procedure TMainForm.NavTreeClick(Sender: TObject); var Nd : TUniTreeNode; Ts : TUniTabSheet; FrC : TUniFrameClass; Fr : TUniFrame; FClassName, Path: string; begin Path := UniServerModule.StartPath + 'units\'; Nd := NavTree.Selected; if Nd.Count = 0 then begin Ts := Nd.Data; if not Assigned(Ts) then begin Ts := TUniTabSheet.Create(Self); Ts.PageControl := UniPageControl1; Ts.Closable := True; Ts.OnClose := TabSheetClose; Ts.Tag := NativeInt(Nd); Ts.Caption := Nd.Text; Ts.ImageIndex := Nd.ImageIndex; FClassName := 'TUni' + FileNames.Values[Nd.Text]; FrC := TUniFrameClass(FindClass(FClassName)); Fr := FrC.Create(Self); Fr.Align := alClient; Fr.Parent := Ts; Nd.Data := Ts; end; UniPageControl1.ActivePage := Ts; end; end; ... Hi Sherzod Thanks for the speedy response :-) Is there a much simpler example ? Maybe a simple menu or button and upon clicking will launch another 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.