the logic just is screwed up.
couldn't get further than this with your script base:
code:
    $frmDialog1           = createobject("Kixtart.Form")
$frmDialog1.Size = 300,250
$frmDialog1.Caption = "Select Colors"
$picChoice = $frmDialog1.PictureBox("",5,60,285,160)
$picChoice.DrawWidth = 2 ;pixels
$picChoice.FillStyle = 1 ; solid


$color = 0

for $i = 0 to $picChoice.ClientWidth step 2
for $j = 0 to $picChoice.ClientHeight step 2
$picChoice.forecolor=$color
$picChoice.FillColor = $picChoice.ForeColor
$picChoice.Rectangle($i,$j,2,2)
$color=1506+$color
next
next


$frmDialog1.Show
while $frmDialog1.Visible
$ = execute($frmDialog1.DoEvents)
loop

should it be re-written?

anyway, didn't test that your getting-better code yet so dunno.

and, btw, you don't need any break ons as there is only wkix code.
_________________________
!

download KiXnet