Sub btnCustom_Click
Dim cd As CustomDialog
Dim pnl As Panel
pnl.Initialize("pnl")
Dim bgnd As ColorDrawable
bgnd.Initialize(Colors.Green, 5dip)
pnl.Background = bgnd
Dim btn1 As Button
btn1.Initialize("btn1")
btn1.Text = "Press me"
pnl.AddView(btn1, 80dip, 50dip, 60dip, 60dip)
lbl1.Initialize("")
[COLOR="Red"]pnl.LoadLayout("layout") ' add this line[/COLOR]
pnl.AddView(lbl1, 50dip, 120dip, 120dip, 60dip)
cd.AddView(pnl, 5%x, 0%y, 77%x, 70%y) ' sizing relative to the screen size is probably best
ret = cd.Show("B4A Custom Dialog", "Yes", "No", "Maybe", Bmp)
End Sub