|
-
Mar 1st, 2006, 02:24 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] form not locking?
I want to set my form so no one can resize it and i have two problems:
1. i set the locked property to true and the user is still able to move and resize the form??
2. is there a way to only stop the user from resizing the form?? i want to allow moving of the form...
Thanks
GTJ
-
Mar 1st, 2006, 03:09 PM
#2
Re: form not locking?
Did you set FormBorderStyle to FixedSingle?
If that's not working, you can also set the maximum and minimum size to the same value.
(Note, in order to see the formborderstyle, you need to turn "Locked" off. The only thing that changes is your IDE's state, not the run state)
-
Mar 1st, 2006, 04:02 PM
#3
Thread Starter
Hyperactive Member
Re: form not locking?
cheers that works perfectly, another question:
What event is called when the user clicks on the X in the top right corner??
(i want to give a "do u want to save changes" message box before the form closes, and allow the user to cancel the close)
-
Mar 1st, 2006, 04:04 PM
#4
Re: form not locking?
It calls a series of events, but the one that would best suite you is "Closing."
-
Mar 1st, 2006, 04:19 PM
#5
Re: form not locking?
System.Windows.Forms.Form.Closing?
Sure there is...
 Originally Posted by ObjectBrowser
public event System.ComponentModel.CancelEventHandler Closing
Member of System.Windows.Forms.Form
Summary:
Occurs when the form is closing.
-
Mar 1st, 2006, 04:22 PM
#6
Thread Starter
Hyperactive Member
Re: form not locking?
yep sorry, i was looking for 'closing' after further searchin i found 'formclosing'.
sorry bout that. :-|
that has sorted my problem. Thanks.
GTJ
-
Mar 1st, 2006, 04:27 PM
#7
Re: [RESOLVED] form not locking?
No worries 
Code:
this.Closing += new System.ComponentModel.CancelEventHandler(this.Form1_Closing);
-
Mar 1st, 2006, 05:05 PM
#8
Re: [RESOLVED] form not locking?
In .NET 1.x you use the Closing event. In .NET 2.0 you use FormClosing. Just another example of why it's importatnt to specify which version you're using when you post.
-
Mar 1st, 2006, 05:07 PM
#9
Thread Starter
Hyperactive Member
Re: [RESOLVED] form not locking?
ok, cool will do in the future....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|