Jump to content

MainForm 2 Kere Create Oluyor


multimesut

Recommended Posts

Merhaba,

 

 

Yeni bir proje açıp sadece LoginForm ekliyorum. Aşağıdaki gibi basit bir kullanımda MainForm 2 kere create oluyor. Örnek için basit kod yaptım. Aslında login durumlarına göre yetkili formu create edip main içerisine basıyorum. "tKullanici.Parent:=Main.MainForm;". Değişkenlerine eriştiğim zaman create oluyor. Birde login form kapatırken create ediyor. Zaten Create edildi ise birdaha create edilmemesi lazım. Bir bug gibi geldi bana. Kullandığım sürüm "1.0.0.1420".

 

Teşekkürler..

 

 

procedure TUniLoginForm1.btnLoginClick(Sender: TObject);

begin

main.MainForm.UniEdit1.Text:='Merhaba';

ModalResult:=mrOK;

end;

Link to comment
Share on other sites

Hi,

 

You should use like in this demo example:

\FMSoft\Framework\uniGUI\Demos\Desktop\LoginForm
type
  TUniMainModule = class(TUniGUIMainModule)
  private
    { Private declarations }
  public
    { Public declarations }
    AUserName : string;
  end;
procedure TUniLoginForm1.UniButton1Click(Sender: TObject);
begin
  UniMainModule.AUserName := 'This User'; //<----------
  ModalResult:=mrOK;  
end;
procedure TMainForm.UniFormShow(Sender: TObject);
begin
  UniLabel1.Caption := UniMainModule.AUserName;
end;
Link to comment
Share on other sites

Tüm ortak verilerim MainModule de. Fakat UniGUI de tek bir MainForm Page olabildiği için diğer sayfalarımı MainForm a Parent kullanıyorum (tFirma.Parent:=Main.MainForm;). Hal böyle oluncada MAIN e dokunmak gerekiyor. Aslında UniGUI sadece tek bir MainForm Page olarak tasarlanmış, ikinci MainForm i create etmemesi gerek.

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...