Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Ribbon Tech Support » Disabling the System Close Collapse All
Subject Author Date
d a Feb 10, 2010 - 6:07 AM

Under Vista if we disable the System Close (X button top right corner) with

        private const int SC_CLOSE = 0xF060;
        private const int MF_BYCOMMAND = 0x0;
        private const int MF_ENABLED = 0x0;
        private const int MF_DISABLED = 0x2;

        [DllImport("user32.dll")]
        private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);

        [DllImport("user32.dll")]
        private static extern int EnableMenuItem(IntPtr hMenu, int wIDEnableItem, int wEnable);
..........
..........
            int state = m_enable ? MF_ENABLED : MF_DISABLED;
            IntPtr hMenu = GetSystemMenu(m_form.Handle, false);

            EnableMenuItem(hMenu, SC_CLOSE, MF_BYCOMMAND | state);

we get a disabled X button displayed on the ribbon so far so good.

However under Windows XP the Ribbon Bar X button the behaviour is inconsistent. On a form without the ribbon bar the X Button appears disabled, with the Ribbon Bar present the the button appears enabled?,

How can I make the button appear disabled?

Thanks

Technical Support Mar 3, 2010 - 9:22 AM

We reproduced the bug. Thank you. It is fixed already. The fix will be available in v.3.6, which is coming soon.

d a Feb 26, 2010 - 4:15 AM

Any results on this yet?


 


Thanks

Technical Support Feb 10, 2010 - 12:31 PM

Thank you for reporting the problem. We will check it and let you know the results.

d a Oct 5, 2010 - 4:36 AM

Guys,


Discovered another little issue with this. It would appear that minimizing the Application with the close button disabled and then re-selecting the application from the Start bar re-enables the close button


 

Technical Support Oct 6, 2010 - 6:07 AM

It doesn’t deal with Elegant Ui, it is the way Windows Forms works. You should update the Close button state after restoring.