Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem Setting Form Position

Status
Not open for further replies.

smeeks

Programmer
Oct 7, 2003
31
US
I have a form that I start maximized and if the user moves it I have a line of code in the form move event:

me.location = new point(0,0)

.....hoping this would not allow them to move the form....but the form is still able to be moved. I know my event is firing properly...I have checked that. Is there form properties that I may have set wrong that do not allow my code to work? What am I doing wrong?

Thanks for any help.
 
Hi,

I tried it and it worked fine, but it looked ugly because the window stays in 0,0 but a copy of it is looked dragged and vanished.
You can do something else. Try this:
Code:
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None

Now you won't see a border that the user can drag and you can't resize the form. If you still want to see a caption bar you can draw one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top