Jump to content

How to call a new form from a UniFrame?


55143681

Recommended Posts

  • 3 weeks later...
  • 2 weeks later...
  • Administrators

Correct syntax is:

void __fastcall TUniFrame1::UniBitBtn1Click(TObject *Sender)
{
	TUniForm1 *newForm = new TUniForm1(UniApplication());
	newForm->ShowModal();
}

Inside a context of a frame,  UniApplication is a function!

Inside a form it is a property!

That's the reason!

I will try to fix it by defining it as a property in a frame also!

Link to comment
Share on other sites

4 hours ago, Farshad Mohajeri said:

Correct syntax is:


void __fastcall TUniFrame1::UniBitBtn1Click(TObject *Sender)
{
	TUniForm1 *newForm = new TUniForm1(UniApplication());
	newForm->ShowModal();
}

Inside a context of a frame,  UniApplication is a function!

Inside a form it is a property!

That's the reason!

I will try to fix it by defining it as a property in a frame also!

Thank you very much!

Thank you very much!

Thank you very much!

Thank you very much!

Thank you very much!

Link to comment
Share on other sites

11 hours ago, Hayri ASLAN said:

Hi,

Add UniGuiApplication to uses

 

Does not work,why?

 

 

 

unit UnitFrame3;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics,
  Controls, Forms, uniGUITypes, uniGUIAbstractClasses,
  uniGUIClasses, uniGUIForm,uniGUIFrame, uniGUIBaseClasses,
  uniLabel, uniButton, uniBitBtn,uniGUIRegClasses,uniGUIApplication;

type
  TUniFrame3 = class(TUniFrame)
    UniLabel1: TUniLabel;
    UniBitBtn1: TUniBitBtn;
    procedure UniBitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

implementation

{$R *.dfm}

uses UnitFormInst, MainModule, Main;

procedure TUniFrame3.UniBitBtn1Click(Sender: TObject);
var
formInst:TUniFormInst;
begin
 formInst:=TUniFormInst.Create(UniApplicaton);//创建子窗口
 formInst.ShowModal;//调用子窗口
end;

end.

Link to comment
Share on other sites

12 hours ago, Hayri ASLAN said:

Hi,

Can you please create test case? I can't reproduce it.

Sorry,that is my wrong.

thank you,Hayri ASLAN

 

unit UnitFrame3;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics,
  Controls, Forms, uniGUITypes, uniGUIAbstractClasses,
  uniGUIClasses, uniGUIFrame, uniGUIBaseClasses, uniLabel, uniButton, uniBitBtn;

type
  TUniFrame3 = class(TUniFrame)
    UniLabel1: TUniLabel;
    UniBitBtn1: TUniBitBtn;
    procedure UniBitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

implementation

{$R *.dfm}

uses UnitFormInst,uniGUIApplication;

procedure TUniFrame3.UniBitBtn1Click(Sender: TObject);
var
formInst:TUniFormInst;

begin
    formInst:=TUniFormInst.Create(UniApplication);//创建子窗口
    formInst.ShowModal;//调用子窗口

end;

end.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...