改成
if  ((not(button1.Enabled)) or (not(button2.Enabled))) then
这样形式的ok了