Jump to content

in UniLoginFormCreate, UniApplication.ScreenWidth 's value is "0"


Freeman35

Recommended Posts

in UniLoginFormCreate, UniApplication.ScreenWidth 's value is "0" how can I get screenwidth while or before UniLoginFormCreate ?

procedure TFRM_Login.UniLoginFormCreate(Sender: TObject);
begin
  Self.BorderStyle:= bsNone;
  Self.Left:= UniApplication.ScreenWidth div 2;

Thank you.

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

 

Can help you,

 

Try...

 

1. UniLoginForm1.Script ...

window.onresize = function(){
  if (typeof UniLoginForm1 !== 'undefined') {  
    var getSize = Ext.getBody().getViewSize(),
        winWidth = getSize.width,
        winHeight = getSize.height,
        left = (winWidth - UniLoginForm1.window.width) / 2,
        top = (winHeight - UniLoginForm1.window.height) / 2;

    UniLoginForm1.window.setPosition(left, top);
  }
}

2. UniLoginForm1.AlignmentControl -> uniAlignmentClient

 

http://forums.unigui.com/index.php?/topic/5950-how-set-center-login-form-when-resize-browser/&do=findComment&comment=30485

 

Best regards,

Link to comment
Share on other sites

Thank you so much for help.

This is work like, what I want.

 

Q: Why FormScreenResize event not triggered? when resize browser.

 

@Farshad

I wanna center my loginform on browser. maybe other form(s) in future.  And I have no idea (I hope yet) uniGUI mecanism. If I'm not wrong, before create and show loginform, has to created server and main module, this mean can get some info from browser. ofcourse this is my idea, no knowledge yet. I'm still learning mode. (I hope this session be short :) )

Thank for answers.

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