Just trying to isolate and maybe re-create the problem with this script. Im sure that some combination of show,hide,visible,show(n) will repro the problem (prob something to do with show(n), as that was last thing added.

code:
break on

$form = createobject("kixtart.form")
$form.caption = mainform
$form.fontname = verdana
$form.fontsize = 12

$button = $form.commandbutton("popup")
$button.center
$button.onclick = "pop"

$form.center
$form.show
while $form.visible
$=execute($form.doevents)
loop

exit 1

function pop

dim $popup

$popup = createobject("kixtart.form")

$popup.caption = popup
$popup.witdh = 200
$popup.height = 200
$popup.center

; $form.show(0)
$form.visible = 0

$popup.show(1)

while $popup.visible
$=execute($popup.doevents)
loop

$form.visible = 1

endfunction