Bug? Panel Placement Bug Perhaps?

Mashiane

Expert
Licensed User
Longtime User
Hi

I have designed some panels on my form and placed them at the bottom of the screen. When the form shows I want them to be placed at particular positions of the screen. It seems like no matter what I try these are not moved. Is there something I'm missing like a redraw function perhaps?

I have included the source here, trying either dip at the values does not help either. Can someone advise please?

Panel1.png and Panel2.png should be the right position. (see the top and left properties)
Designer.png is what is in the designer.

Below is my code...

B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'Public variables can be accessed from all modules.
    Public App As Application
    Public NavControl As NavigationController
    Private Page1 As Page

    Private Button1 As Button
    Private Panel1 As Panel
    Private Panel2 As Panel
    Private Button2 As Button
End Sub

Private Sub Application_Start (Nav As NavigationController)
    NavControl = Nav
    Page1.Initialize("Page1")
    Page1.Title = "Page 1"
    Page1.RootPanel.LoadLayout("vmain") 
    Page1.RootPanel.Color = Colors.White
    NavControl.ShowPage(Page1)
    Panel1.Top = 190dip
    Panel1.Left = 120dip
    Panel2.Top = 10dip
    Panel2.Left = 10dip
End Sub

Sub Page1_appear
    Panel1.Top = 190dip
    Panel1.Left = 120dip
    Panel2.Top = 10dip
    Panel2.Left = 10dip
End Sub

Sub Button1_Click
   
    Panel1.Visible = True
    Panel2.Visible = False
End Sub

Sub Button2_Click
   
    Panel2.Visible = True
    Panel1.Visible = False
End Sub
 

Attachments

  • panel1.png
    panel1.png
    29.3 KB · Views: 234
  • panel2.png
    panel2.png
    30.3 KB · Views: 233
  • designer.png
    designer.png
    31.5 KB · Views: 243
  • panels.zip
    14.5 KB · Views: 238
Top