B4J Question Loadlayout and background color

vpires

Member
Licensed User
Longtime 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

  • test.zip
    8.6 KB · Views: 97

Erel

B4X founder
Staff member
Licensed User
Longtime 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.
 
Upvote 0
Top