Hello to all Forum Members;

Currently I'm working on a project in which under certain circumstances, I need to make the Form unmovable. I know we have the "Moveable" form property but unfortunately that's not available at Runtime. So, I was thinking of doing it in one way or the other. I tried following way of doing it which is a very raw mode and that's why I'm here in need of your expert help.

I added a timer control with Intervel = 20. When I need to lock the form position and want to make it Non moveable then firstly I store the Form's current Left and Top to two module level variables and then enable the timer. On Timer event, I check form's current Top and Left positions with the previously stored one and if different then I restore the previous values emulating the Form as non-movable.

Though it works and serves the purpose, there are two major issues involved in it:

[1] When attempting to move the form in (so called) Locked state, it flickers a lot.
[2] Though the timer is running, I still can move the form from somewhat quickly which is not the proper emulation of "Moveable = False" property.

So, I was thinking of some other way of doing it than this raw method of using VB timer. Can you please suggest me any? Do I need to go for Subclassing? Please guide me how can I achieve the desired effect of "Moveable = False" property at runtime.

Waiting for your valuable reply ...

Regards,

Ruturaaj.