Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


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

Locking a Form in Position

Question:
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?

Answer:
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.

 

 

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