I have solved the problem below, but new problem exist :
How to gain control for the OK or CANCEL button while Button1 is pressed and in the loop?
I want the variable to be updated continuously after I pressed a button. However, I can't do that with UpdateData(false) which placed inside a loop. Anyone know the solution?
My sample code: