Are you saying that your second form is using my FormImmobiliser class and it won't restore after being minimised?Quote:
Originally Posted by Simply Me
Printable View
Are you saying that your second form is using my FormImmobiliser class and it won't restore after being minimised?Quote:
Originally Posted by Simply Me
Yes. My second form uses your FormImmobiliser class. My second form BorderStyle is FixedToolWindow. Whenever I click the form's name in the task bar it automatically minimizes and when I right click and choose restore or maximize it is not restoring.
I've changed the code for the FormImmobiliser class. Download the new version from post #1 and see if that addresses the issue.Quote:
Originally Posted by Simply Me
Great it works now!
Thanks!
Hi JM
I am using both of your classes after loading a form (frmSixQs) from a child form (frmProfiles). All runs as expected, except when I click off the form (frmSixQs), it closes.
How do I make my form focused exclusively until the user closes it intentionally?
That doesn't sound like anything that would be caused by my code but I'll run some tests just to make sure.Quote:
Originally Posted by Always_Confused
I tested my classes with all combinations of Show and ShowDialog with 1, 2 and 3 forms and saw no such behaviour, so I can only assume that it's something to do with your own code. What happens if you remove my classes? Do you still see that behaviour?Quote:
Originally Posted by Always_Confused
The SystemMenuManager class doesn't seem to have any effect on the close button of a FixedToolWindow form. Problem encountered in Windows Vista SP1. I tried setting the SMM both to disable and to remove the close button, with absolutely no effect whatsoever. Here's the declaration:
For now, I've set the ControlBox property to False, however I'd also like to block the Alt + F4 key combination, which seems to work, albeit erratically. I will explore the problem further and attempt to narrow down the source of the problem. I'll keep you posted as best I can, given my poor internet connection.Code:Private smm As New SystemMenuManager(Me, SystemMenuManager.MenuItemState.Removed)
I probably never tested that scenario. I'll have a look myself too, when I get the chance. Out of town visiting my dad for this Australia Day long weekend. Submitting this using his brand new Internet connection.Quote:
Originally Posted by obi1kenobi
What Is the value of the Size menu Item? I would like to disable form sizing but, I need to have it have a sizable border style? I hope I didn't pass over it while scanning the forum. I have tried Googleing it but, that results in "Set the border style to something with Fixed in it."
Thanks!
E
Hi,
I was using your formImmobiliser.vb class only since i use vb .net 2005.
Then i declared Dim frmMove As New FormImmobilisre(Me) in 'declarations' region. That's it?
but it doen't work properly. where to declare dim statement and anything else to do?
form will move only upwards (no left, right, down).
can you give code sample how to use your class?
oh my god i can't enabled my close button :sick:Code:myMenuManager = New SystemMenuManager(_handle, True, SystemMenuManager.MenuItemState.Enabled)
Um, huh? The Close button is enabled by default, so you don't have to do anything to enable it. The whole point of this thread is to disable it. Are you saying, without actually saying, that you have already disabled it and then you want to re-enable it at some point?
Sounds like its being disabled but they are not able to re-enable it. Since its probably a coding issue not directly related I would suggest posting a new thread in the VB.NET forum and link/reference this codebank thread so all can assist you better. :)
ok Thank you Mr.SuperModerator.....
Hi, I know this is an old thread but I was hoping someone could help me. I am using the Form Immobilizer and it is working great. What I would like to know is if it is possible to enable/disable the feature during run time or by changing a setting in an ini file?
Thanks
This is the part that actually stops the form moving:If you want to allow the form to move then all you need to do is not execute that bit of code. It's already in an If block so all you have to do is add a flag to that If statement that can be set from outside, e.g.Code:Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_MOVING Then
Marshal.StructureToPtr(New RECT(Me.target.Bounds), _
m.LParam, _
False)
m.Result = New IntPtr([TRUE])
End If
MyBase.WndProc(m)
End Sub
vb.net Code:
Public Property CanMove As Boolean Protected Overrides Sub WndProc(ByRef m As Message) If Not CanMove AndAlso m.Msg = WM_MOVING Then Marshal.StructureToPtr(New RECT(Me.target.Bounds), _ m.LParam, _ False) m.Result = New IntPtr([TRUE]) End If MyBase.WndProc(m) End Sub
That's brilliant.
Thanks