예제 #1
0
        public System.Drawing.Color GetThemeColor(ColorProperty color)
        {
            if (this.currentElement == null || this.currentHTheme == IntPtr.Zero)
            {
                return(System.Drawing.Color.Empty);
            }
            int pColor = 0;

            UXTheme.GetThemeColor(this.currentHTheme, this.currentElement.Part, this.currentElement.State, (int)color, ref pColor);
            return(ColorTranslator.FromWin32(pColor));
        }
예제 #2
0
        /// <summary>
        /// Gets the Color defined for the current element.
        /// </summary>
        /// <param name="color"></param>
        /// <returns></returns>
        public Color GetThemeColor(ColorProperty color)
        {
            if (this.currentElement == null || currentHTheme == IntPtr.Zero)
            {
                return(Color.Empty);
            }

            int themeColor = 0;

            UXTheme.GetThemeColor(this.currentHTheme, currentElement.Part, currentElement.State, (int)color, ref themeColor);

            return(ColorTranslator.FromWin32(themeColor));
        }