How to prevent users from changing the location of windows [duplicate]
Possible Duplicate:
Fixing the position of a form
in my application some forms must be not moving by users. how can i disable move forms another location.
i put that code on form_load
this.ControlBox = false; this.Text = string.Empty;
when form's title is empty form cant be move another location. but i want to keep form title.
is there a way?
I'm not sure this is the best way, but you can do something like in following code to avoid changing form current location :
public Form1()
{
InitializeComponent();
pt = this.Location;
}
private Point pt;
private void Form1_Move(object sender, EventArgs e)
{
this.Location = pt;
}
hope this help.
精彩评论