Overlay = xui.CreatePanel("")
Overlay.As(Panel).Elevation = 100dip 'ADD THIS. 100dip is an exageration but to avoid other panels with already higher Elevation
Overlay.Color = xui.Color_ARGB(120, 0, 0, 0)
mParent.AddView(Overlay, 0, 0, mParent.Width, mParent.Height)
' Main Popup
Popup = xui.CreatePanel("")
Popup.Color = Colors.White
Popup.SetColorAndBorder(Colors.White, 0, 0, 20dip) ' angoli arrotondati
Dim dlgWidth As Float
If mParent.Width>mParent.Height Then
dlgWidth = Min(mParent.Width * 0.4, 400dip)
Else
dlgWidth = Min(mParent.Width * 0.8, 400dip)
End If
Overlay.AddView(Popup, 0, 0, dlgWidth, 1dip) 'HERE CHANGE mParent to Overlay
Dim TopPos As Float = 20dip