Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Visual Basic
Expertise: Beginner
Jul 7, 1997



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Locking a Form in Position

How do you lock down a form so that when the program is run, you can not move it. What I want to do is have one main form, with another smaller form within it. I want to lock the smaller form in place so it can not be moved around. The only way I have been able to do this is to disable the form. But I need the form enabled. How would I accomplish this?

I would recommend using the Paint event to position the form to a particular X, Y coordinate pair. The Paint event is called whenever the form is drawn or moved. Just set the Top and Left properties of the form to your preselected values and the form will appear to be locked in place.

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date