B4J Question Loadlayout and background color

Discussion in 'B4J Questions' started by vpires, Aug 1, 2019.

  1. vpires

    vpires Member Licensed User


    Headbang with this one. Please check the attached project and uncomment only the line
    Why doesn't the background color stay darkgrey, if i'm not adding the pane to the form ?


    Attached Files:

  2. Erel

    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:
    Sub paintDesktop(frm As Form)
       MainForm = frm
    'MainForm.RootPane.LoadLayout("teclado_numerico") 'Load the layout file.
    Dim x As B4XView = MainForm.RootPane
       x.Color = xui.Color_Transparent
    End Sub
    Though I recommend you to create a layout for the form and load it. Set the color of Main to be gray.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice