开发者

How to prevent users from changing the location of windows [duplicate]

开发者_Python百科This question already has answers here: Closed 11 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜