summaryrefslogtreecommitdiffstats
path: root/win/CS/Functions/ToolStripRenderOverride.cs
blob: 28845c2ed171988a5e7c33571ef715927453c54a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*  ToolStripRenderOverride.cs $
    This file is part of the HandBrake source code.
    Homepage: <http://handbrake.fr/>.
    It may be used under the terms of the GNU General Public License. */

namespace Handbrake.Functions
{
    using System.Windows.Forms;

    public class ToolStripRenderOverride : ToolStripProfessionalRenderer
    {
        ToolStripSystemRenderer render = new ToolStripSystemRenderer();
    
        public ToolStripRenderOverride()
        {       
        }

        /// <summary>
        /// Fix for a bug in .NET where a white line appears at the bottom of the control.
        /// http://connect.microsoft.com/VisualStudio/feedback/details/92862/toolstrip-always-draws-a-border-on-the-bottom-with-rendermode-system-and-docked-left-or-right
        /// </summary>
        /// <param name="e">
        /// ToolStripRenderEventArgs 
        /// </param>
        protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e)
        {
            //base.OnRenderToolStripBorder(e);
        }

        /// <summary>
        /// Change the Button Hover Background style to the system button style
        /// </summary>
        /// <param name="e">
        /// ToolStripRenderEventArgs
        /// </param>
        protected override void OnRenderButtonBackground(ToolStripItemRenderEventArgs e)
        {     
            render.DrawButtonBackground(e);
        }

        protected override void OnRenderDropDownButtonBackground(ToolStripItemRenderEventArgs e)
        {
            render.DrawDropDownButtonBackground(e);
        }

        protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e)
        {
            //base.OnRenderToolStripBackground(e);
        }  
    }
}