define class CMyform as form
*只要将以下紧挨的两行交换,就会出现你所说的情况,原因就是交换后控件的TABIndex发生了变化,先添加的控件默认为在靠下的一层。
add object text1 as textbox with left=60,top=100,width=50,height=20
add object shape1 as shape with left=30,top=70,width=200,height=80,fillstyle=0,fillcolor=rgb(128,128,192)
add object cmd1 as commandbutton with left=10,top=10,caption='\<Close',height=24,width=40