ZeroEffect Posted June 28, 2006 Posted June 28, 2006 Here is what I am trying to accompilish. I want to give the use the option to Lock the form on the screen so no one can move the form. I see there is a lock option when you view the form properties but it doesn't seem to be accessible by code. I have tried locking the position by the Move event on the form. This works to a point, you are still able to move and you see it snap into place. This is not visually pleasing. Does anyone have an idea on how to make this work. Thanks ZeroEffect Quote If you can't find it, Build It. There is no place Like 127.0.0.1 also don't forget 1 + 1 = 10
SonicBoomAu Posted June 28, 2006 Posted June 28, 2006 Why not change the form to a fixed dialog and set topmost to true Me.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedDialog me.Topmost = true Hope this helps Quote Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -- Rick Cook, The Wizardry Compiled
ZeroEffect Posted June 28, 2006 Author Posted June 28, 2006 Why not change the form to a fixed dialog and set topmost to true Me.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedDialog me.Topmost = true Hope this helps Thats not a bad idea, but I'm looking more twards making the form non-movable. I might add your suggestion too. Thanks for the idea. ZeroEffect Quote If you can't find it, Build It. There is no place Like 127.0.0.1 also don't forget 1 + 1 = 10
Administrators PlausiblyDamp Posted June 28, 2006 Administrators Posted June 28, 2006 You could always try handling the Move event and just reseting the position back, not sure how that would look though. If it doesn't look too good the nyou might need to handle the WM_MOVE or similar messages yourself and just ignore them. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
ZeroEffect Posted June 28, 2006 Author Posted June 28, 2006 Handling the Move event Looks very bad. How would I go about Handleing the WM_Move Messages? thanks ZeroEffect Quote If you can't find it, Build It. There is no place Like 127.0.0.1 also don't forget 1 + 1 = 10
Arch4ngel Posted June 28, 2006 Posted June 28, 2006 That lead you back to linking your code to Microsoft non-managed DLL. You might get information on how to do it through: http://www.codeproject.com/vb/net/ClickThroughWindows.asp?df=100&forumid=262268&exp=0&select=1356584 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowmessages/wm_move.asp But never did it personally. You might want to take a look at WM_Moving too. Here you go. Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
ZeroEffect Posted July 1, 2006 Author Posted July 1, 2006 Very interesting, I'll have to play with those ideas this comming week. Thanks for the info. ZeroEffcet Quote If you can't find it, Build It. There is no place Like 127.0.0.1 also don't forget 1 + 1 = 10
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.