Freeman35 Posted June 15, 2017 Share Posted June 15, 2017 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. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 15, 2017 Share Posted June 15, 2017 Hi, Which edition and build are you using? Best regards, Quote Link to comment Share on other sites More sharing options...
Freeman35 Posted June 16, 2017 Author Share Posted June 16, 2017 Sorry I forget wrote detail. uniGUI Complete Trial Edition 1.00RC1397 win10 Delphi 10.2. upd1 Thank you Quote Link to comment Share on other sites More sharing options...
Freeman35 Posted July 2, 2017 Author Share Posted July 2, 2017 this bug still continue on 1.0.0.1399_RC Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 2, 2017 Administrators Share Posted July 2, 2017 this bug still continue on 1.0.0.1399_RC Hello, Technically, it is not possible to get browser width height when first request is received from the browser. Browser HTTP headers do not include any size parameters. Why do you need size value? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 2, 2017 Share Posted July 2, 2017 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, Quote Link to comment Share on other sites More sharing options...
Freeman35 Posted July 2, 2017 Author Share Posted July 2, 2017 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. 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.