Windows XP Tweak - CommandLink

Topics: Developer Forum
Jan 20, 2010 at 8:36 AM

 

Hi,

I understand that the purpose of this project is to create Windows Forms Aero controls, but what happens when they are used on Windows XP (or lower).

I thought you may like to know that when the CommandLink control is used on a form that is running on Windows XP, it appears as invisible.  There is a very simple tweak to fix this, and display a very normal looking Windows Forms button.

 

CommandLink.cs

 

        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams cp = base.CreateParams;

                if (Environment.OSVersion.Version.Major > 5)
                    cp.Style |= NativeMethods.BS_COMMANDLINK;
                else
                    cp.Style |= 1;
                return cp;
            }
        }

 

I am sure this probably applies to other VistaControls, but I have not yet tested it.

I apologise if this has been covered before.

thanks

 

 

Developer
Jun 6, 2010 at 10:46 PM
Sorry for taking such a long time. I just checked in your fix. Thank you. :)