B4J Question Loadlayout and background color

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

  1. vpires

    vpires Member Licensed User

    Hello,

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

    TIA
     

    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:
    Code:
    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.
     
Loading...
  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