Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

If you can't find it, Build It.

 

There is no place Like 127.0.0.1 also don't forget 1 + 1 = 10

Posted

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

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

Posted
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

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
Posted

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.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

Handling the Move event Looks very bad. How would I go about Handleing the WM_Move Messages?

 

thanks

 

ZeroEffect

If you can't find it, Build It.

 

There is no place Like 127.0.0.1 also don't forget 1 + 1 = 10

Posted

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.

"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

Posted

Very interesting, I'll have to play with those ideas this comming week.

 

Thanks for the info.

 

ZeroEffcet

If you can't find it, Build It.

 

There is no place Like 127.0.0.1 also don't forget 1 + 1 = 10

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...