usvpn Posted January 8, 2011 Posted January 8, 2011 Hi, I need to disable the form's context menu, when you right click on a form's caption bar a context menu appear. Please see my snapshot. How to do that in VB.NET? Thank you. Quote
orca44 Posted January 12, 2011 Posted January 12, 2011 (edited) You could set the Form's ControlBox property to false. That would completely remove the context menu. Is it important to still display the disabled close button? To do that you need to add this : Private Const CP_NOCLOSE_BUTTON As Integer = &H200 Protected Overrides ReadOnly Property CreateParams() As CreateParams Get Dim myCp As CreateParams = MyBase.CreateParams myCp.ClassStyle = myCp.ClassStyle Or CP_NOCLOSE_BUTTON Return myCp End Get End Property Edited January 12, 2011 by orca44 Quote
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.