Disable form minimizing

garyd1234

Board Regular
Joined
Apr 17, 2003
Messages
103
Hi,
I have a form that I want to load based on who is logged in. I want to make it so they cannot minimize it and see what is behind it. I have security set up so they cannot get into tables, forms, etc but it would be great if they also couldn't see behind the form. I maximize the form and set its Popup and modal to yes and Borderstyle to dialog. This takes away the max, min, and close buttons but, if the user double clicks on the border it still makes the form about half size and they can still drag it around. How do I stop this in code so administrators will have the min, max etc. but certain log in people will not?

Thanks
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi,
I couldn't replicate the double clicking of the border to resize, once the form was maximized the entire window reacted to the resize on border double click. I still couldn't see into the database window (behind the open form).
To change these properties on the fly put the following in the form code
The built in help has more info on the different settings
Private Sub Form_Open(Cancel As Integer)
Me.BorderStyle = 1 'Sets border to thin and is not resizable
Me.AutoCenter = True
Me.AutoResize = False
Me.PopUp = True ' popup keeps it on top
Me.MinMaxButtons = 0 ' the Min Max buttons are not visible with this setting
End Sub
 
Upvote 0

Forum statistics

Threads
1,221,539
Messages
6,160,412
Members
451,644
Latest member
hglymph

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top