Good day all,
I am converting a B4J project to use B4XPages, and i used to center my forms using the CenterForm sub code:
But that doesn't work anymore, what am i missing???
I am converting a B4J project to use B4XPages, and i used to center my forms using the CenterForm sub code:
B4X:
Sub CenterForm(f As Form)
Dim ps As Screen = fx.PrimaryScreen
f.WindowLeft = (ps.MaxX - ps.MinX) / 2 - f.Width / 2
f.WindowTop = (ps.MaxY - ps.MinY) / 2 - f.Height / 2
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("pagelogin")
login_user.Text = "" ' Clear user
login_pass.Text = "" ' Clear password
#if B4J
Dim form As Form = B4XPages.GetNativeParent(Me)
form.WindowWidth = 320dip
form.WindowHeight = 190dip
form.Icon = fx.LoadImage(File.DirAssets, "icon.png")
CenterForm(form) '<- Form is never screen centered
#end if
End Sub
But that doesn't work anymore, what am i missing???
Last edited: