B4J Question Loadlayout and background color

vpires

Member
Licensed User
Hello,

Headbang with this one. Please check the attached project and uncomment only the line
B4X:
'Log(p.LoadLayout("teclado_numerico"))
Why doesn't the background color stay darkgrey, if i'm not adding the pane to the form ?

TIA
 

Attachments

Erel

Administrator
Staff member
Licensed User
There are things that you should never use. AnchorPane is one of them.

Form.BackColor is only relevant if you want to create a transparent form. It is simpler to set the RootPane color.

You can make it transparent:
B4X:
Sub paintDesktop(frm As Form)
   MainForm = frm
   'MainForm.RootPane.LoadLayout("teclado_numerico") 'Load the layout file.
   utils.maxWindow(MainForm)
   MainForm.BackColor=fx.Colors.DarkGray
   Dim x As B4XView = MainForm.RootPane
   x.Color = xui.Color_Transparent
   MainForm.Show
End Sub
Though I recommend you to create a layout for the form and load it. Set the color of Main to be gray.
 
Top