亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tristatetree.cs

?? 對ima、imz壓縮文件修改
?? CS
?? 第 1 頁 / 共 2 頁
字號:
                    this.UpdateChildNodeState();

                this.UpdateParentNodeState(true);

                tv.EndUpdate();
            }
        }

        /// <summary>
        /// Recursiveley update child node's state based on the state of this node.
        /// </summary>
        private void UpdateChildNodeState()
        {
            ThreeStateTreeNode child;
            foreach (TreeNode node in this.Nodes)
            {
                // It is possible node is not a ThreeStateTreeNode, so check first.
                if (node is ThreeStateTreeNode)
                {
                    child = node as ThreeStateTreeNode;
                    child.Checked = (this.State != CheckBoxState.Unchecked);
                    child.State = this.State;
                    child.UpdateChildNodeState();
                }
            }
        }

        /// <summary>
        /// Recursiveley update parent node state based on the current state of this node.
        /// </summary>
        private void UpdateParentNodeState(bool isStartingPoint)
        {
            // If isStartingPoint is false, then know this is not the initial call
            // to the recursive method as we want to force on the first time
            // this is called to set the instance's parent node state based on
            // the state of all the siblings of this node, including the state
            // of this node.  So, if not the startpoint (!isStartingPoint) and
            // the state of this instance is indeterminate (CheckBoxState.Indeterminate)
            // then know to set all subsequent parents to the indeterminate
            // state.  However, if not in an indeterminate state, then still need
            // to evaluate the state of all the siblings of this node, including the state
            // of this node before setting the state of the parent of this instance.

            ThreeStateTreeNode parent = this.Parent as ThreeStateTreeNode;
            if (parent != null)
            {
                CheckBoxState state = CheckBoxState.Unchecked;

                // Determine the new state
                if (!isStartingPoint && (this.State == CheckBoxState.Indeterminate))
                    state = CheckBoxState.Indeterminate;
                else
                    state = this.SiblingsState;

                // Update parent state if not the same.
                if (parent.State != state)
                {
                    parent.Checked = (state != CheckBoxState.Unchecked);
                    parent.State = state;
                    parent.UpdateParentNodeState(false);
                }
            }
        }
        #endregion
        private void SetState(CheckBoxState state)
        {
            //            _threeStateChecked = state;
            if (this.TreeView != null && this.TreeView.IsHandleCreated && this.Handle != IntPtr.Zero)
            {
                SetInternalState(state);
            }
        }

        private void SetInternalState(CheckBoxState state)
        {

            ThreeStateTreeView view = this.TreeView as ThreeStateTreeView;
            if (view == null)
                return;

            NativeMethods.TVITEM item = new NativeMethods.TVITEM();
            item.mask = (int)(NativeMethods.TreeViewMask.TVIF_HANDLE | NativeMethods.TreeViewMask.TVIF_STATE);
            item.hItem = this.Handle;
            item.stateMask = (int)NativeMethods.TreeViewStateMask.TVIS_STATEIMAGEMASK;
            switch (state)
            {
                case CheckBoxState.Unchecked:
                    item.state |= 0x1000;
                    break;
                case CheckBoxState.Checked:
                    item.state |= 0x2000;
                    break;
                case CheckBoxState.Indeterminate:
                    item.state |= 0x3000;
                    break;
                default:
                    throw new ArgumentOutOfRangeException("state");
            }

            NativeMethods.SendMessage(
                new HandleRef(this.TreeView, this.TreeView.Handle),
                (int)NativeMethods.Messages.TVM_SETITEM,
                0,
                ref item);

            //view.TreeViewAfterThreeStateCheckUpdate(this);
        }

    }
    internal sealed class NativeMethods
    {

        #region Enums and structs

        [Flags]
        public enum TreeViewMask
        {
            TVIF_TEXT = 0x0001,
            TVIF_IMAGE = 0x0002,
            TVIF_PARAM = 0x0004,
            TVIF_STATE = 0x0008,
            TVIF_HANDLE = 0x0010,
            TVIF_SELECTEDIMAGE = 0x0020,
            TVIF_CHILDREN = 0x0040,
            TVIF_INTEGRAL = 0x0080
        }

        [Flags]
        public enum TreeViewStateMask
        {
            TVIS_SELECTED = 0x0002,
            TVIS_CUT = 0x0004,
            TVIS_DROPHILITED = 0x0008,
            TVIS_BOLD = 0x0010,
            TVIS_EXPANDED = 0x0020,
            TVIS_EXPANDEDONCE = 0x0040,
            TVIS_EXPANDPARTIAL = 0x0080,
            TVIS_OVERLAYMASK = 0x0F00,
            TVIS_STATEIMAGEMASK = 0xF000,
            TVIS_USERMASK = 0xF000
        }

        public enum TreeViewImageListType
        {
            TVSIL_NORMAL = 0,
            TVSIL_STATE = 2
        }


        public enum Messages
        {
            TVM_SETIMAGELIST = 0x1109,
            TVM_SETITEM = 0x110d
        }


        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
        public struct TVITEM
        {
            public int mask;
            public IntPtr hItem;
            public int state;
            public int stateMask;
            public IntPtr pszText;
            public int cchTextMax;
            public int iImage;
            public int iSelectedImage;
            public int cChildren;
            public IntPtr lParam;
        }
        [StructLayout(LayoutKind.Sequential)]
        public struct DLLVersionInfo
        {
            public int cbSize;
            public int dwMajorVersion;
            public int dwMinorVersion;
            public int dwBuildNumber;
            public int dwPlatformID;
        }
        #endregion

        #region Native methods


        [DllImport("user32.dll", CharSet = CharSet.Auto)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, ref NativeMethods.TVITEM lParam);

        [DllImport("user32.dll", CharSet = CharSet.Auto)]
        public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, int lParam);

        [DllImport("comctl32.dll")]
        public static extern IntPtr ImageList_Create(int cx, int cy, int flags, int cInitial, int cGrow);

        [DllImport("Comctl32.dll", EntryPoint = "DllGetVersion", ExactSpelling = true, CharSet = CharSet.Unicode)]
        private static extern int DllGetVersion(ref DLLVersionInfo version);


        #endregion
        public static bool VisualStylesEnabled()
        {
            OperatingSystem os = Environment.OSVersion;
            bool isAppropriateOS = os.Platform == PlatformID.Win32NT && ((os.Version.Major == 5 && os.Version.Minor >= 1) || os.Version.Major > 5);
            bool osFeatureThemesPresent = false;
            bool osThemeDLLAvailable = false;

            if (isAppropriateOS)
            {
                Version osThemeVersion = OSFeature.Feature.GetVersionPresent(OSFeature.Themes);
                osFeatureThemesPresent = osThemeVersion != null;

                DLLVersionInfo dllVersion = new DLLVersionInfo();
                dllVersion.cbSize = Marshal.SizeOf(typeof(DLLVersionInfo));
                int temp = DllGetVersion(ref dllVersion);
                osThemeDLLAvailable = dllVersion.dwMajorVersion >= 5;
            }

            return isAppropriateOS && osFeatureThemesPresent && osThemeDLLAvailable && UXTheme.IsAppThemed() && UXTheme.IsThemeActive();
        }

    }
    internal static class UXTheme
    {
        /// <summary>States available for Button.CheckBox part.summary>
        public enum CheckBoxState : int
        {
            UncheckedNormal = 1,
            UncheckedHot = 2,
            UncheckedPressed = 3,
            UncheckedDisabled = 4,
            CheckedNormal = 5,
            CheckedHot = 6,
            CheckedPressed = 7,
            CheckedDisabled = 8,
            MixedNormal = 9,
            MixedHot = 10,
            MixedPressed = 11,
            MixedDisabled = 12
        };
        /// <summary>Parts available for button control.</summary>
        public enum ButtonPart : uint
        {
            Pushbutton = 1,
            RadioButton = 2,
            Checkbox = 3,
            Groupbox = 4,
            UserButton = 5
            /*
            CommandLink = 6,
            CommandLinkGlyph = 7
            */
        };

        /// <summary>RECT structure.</summary>
        [StructLayout(LayoutKind.Sequential)]
        internal struct RECT
        {
            public int Left;
            public int Top;
            public int Right;
            public int Bottom;

            public RECT(System.Drawing.Rectangle rc)
            {
                Left = rc.X;
                Top = rc.Y;
                Right = rc.Right;
                Bottom = rc.Bottom;
            }

            public RECT(int left, int top, int right, int bottom)
            {
                this.Left = left;
                this.Top = top;
                this.Right = right;
                this.Bottom = bottom;
            }

            /// <summary>
            /// Converts the current <b>RECT</b> to a <see cref="System.Drawing.Rectangle"/>.
            /// </summary>
            public System.Drawing.Rectangle ToRectangle()
            {
                System.Drawing.Rectangle rect = System.Drawing.Rectangle.Empty;

                rect.X = Left;
                rect.Y = Top;
                rect.Width = Right - Left;
                rect.Height = Bottom - Top;

                return rect;
            }
        }

        ////Declare a private constructor so nothing can be instantiated as this class.
        //private UXTheme(){}

        /// <summary>
        /// Closes the theme data handle.
        /// </summary>
        /// <param name="hTheme">Handle to a window's specified theme data.</param>
        [DllImport("UxTheme.dll", CharSet = CharSet.Unicode, SetLastError = true)]
        public static extern int CloseThemeData(IntPtr hTheme);
        /// <summary>
        /// Draws the background image defined by the visual style for the specified control part.
        /// </summary>
        /// <param name="hTheme">Handle to a window's specified theme data.</param>
        /// <param name="hdc">Handle to a device context (HDC) used for drawing the theme-defined background image.</param>
        /// <param name="iPartId">Value that specifies the part to draw.</param>
        /// <param name="iStateId">Value that specifies the state of the part to draw.</param>
        /// <param name="pRect">Pointer to a RECT structure that contains the rectangle, in logical coordinates, in which the background image is drawn.</param>
        /// <param name="pClipRect">Pointer to a RECT structure that contains a clipping rectangle.</param>
        [DllImport("UxTheme.dll", CharSet = CharSet.Unicode, SetLastError = true)]
        public static extern System.Int32 DrawThemeBackground(
            IntPtr hTheme,
            IntPtr hdc,
            UInt32 iPartId,
            UInt32 iStateId,
            ref RECT pRect,
            ref RECT pClipRect
            );

        [DllImport("UxTheme.dll", ExactSpelling = true)]
        public extern static Int32 DrawThemeBackground(
            IntPtr hTheme,
            IntPtr hdc,
            UInt32 iPartId,
            UInt32 iStateId,
            ref RECT pRect,
            IntPtr pClipRect
            );

        /// <summary>
        /// Reports whether the current application's user interface displays using visual styles.
        /// </summary>
        [DllImport("UxTheme", CharSet = CharSet.Unicode, SetLastError = true)]
        public static extern bool IsAppThemed();
        /// <summary>
        /// Tests if a visual style for the current application is active.
        /// </summary>
        [DllImport("UxTheme.dll", CharSet = CharSet.Unicode, SetLastError = true)]
        public static extern bool IsThemeActive();

        public static void LoadCheckBoxImage(System.Windows.Forms.ImageList iList, CheckBoxState state)
        {
            RECT r = new RECT(0, 0, 16, 16);
            Bitmap bmp;
            Graphics g;
            bmp = new Bitmap(16, 16);
            g = Graphics.FromImage(bmp);
            IntPtr gHandle = g.GetHdc();
            IntPtr hTheme = OpenThemeData(IntPtr.Zero, "BUTTON");
            DrawThemeBackground(hTheme, gHandle, (uint)ButtonPart.Checkbox, (uint)state, ref r, IntPtr.Zero);
            CloseThemeData(hTheme);
            g.ReleaseHdc();
            iList.Images.Add(bmp);

        }

        /// <summary>
        /// Opens the theme data for a window and its associated class.
        /// </summary>
        /// <param name="hwnd">Handle of the window for which theme data is required.</param>
        /// <param name="pszClassList">Pointer to a string that contains a semicolon-separated list of classes.</param>
        [DllImport("UxTheme.dll", CharSet = CharSet.Unicode, SetLastError = true)]
        public static extern IntPtr OpenThemeData(
            IntPtr hwnd,
            String pszClassList
            );
    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人在线网站| 在线精品视频一区二区| 捆绑紧缚一区二区三区视频| 天天色综合成人网| 性欧美大战久久久久久久久| 午夜精品久久久久久久蜜桃app| 亚洲一级二级在线| 亚洲二区在线观看| 日韩精品久久理论片| 日本午夜精品视频在线观看| 日韩av成人高清| 麻豆精品一区二区三区| 国内精品嫩模私拍在线| 国产专区综合网| 懂色av一区二区三区免费观看| 国产馆精品极品| 94色蜜桃网一区二区三区| 91色婷婷久久久久合中文| 在线免费视频一区二区| 欧美日韩国产一级二级| 91麻豆精品国产91久久久久| 日韩欧美色综合网站| 国产午夜亚洲精品午夜鲁丝片 | 久久精品一区二区三区av | 国内久久精品视频| 丁香婷婷综合五月| 91香蕉视频污| 欧美一区二区三区四区在线观看| 日韩欧美一区二区不卡| 国产亚洲一区字幕| 亚洲青青青在线视频| 亚洲大片免费看| 玖玖九九国产精品| 成人av在线一区二区| 在线观看网站黄不卡| 日韩亚洲欧美成人一区| 国产午夜精品一区二区三区视频| 亚洲欧美日韩一区| 日韩—二三区免费观看av| 国产精品一区二区在线观看不卡 | 欧美日韩亚洲不卡| 欧美精品一区二区在线播放 | 精品综合久久久久久8888| 成人教育av在线| 欧美色综合天天久久综合精品| 欧美一区二区三区四区五区| 国产免费成人在线视频| 亚洲午夜免费电影| 精品一二线国产| 色综合激情五月| 7777女厕盗摄久久久| 日本一区二区在线不卡| 性久久久久久久久| 不卡的电影网站| 欧美精品在线观看播放| 国产精品网站在线观看| 日韩av电影天堂| 99在线视频精品| 精品国产制服丝袜高跟| 伊人婷婷欧美激情| 国产黄色精品网站| 欧美一区二区三区系列电影| 亚洲视频一区二区在线| 韩国视频一区二区| 欧美日韩久久久| 国产精品美女久久久久久久网站| 免费人成精品欧美精品| 色综合天天综合色综合av| 亚洲男人的天堂在线观看| 美国三级日本三级久久99| 日本久久电影网| 国产色产综合产在线视频| 日韩va欧美va亚洲va久久| 99久久综合狠狠综合久久| 久久这里只有精品6| 日韩在线卡一卡二| 色婷婷综合在线| 亚洲国产精品成人综合色在线婷婷 | 中文字幕第一页久久| 蜜臀av一区二区三区| 欧美亚洲图片小说| 亚洲视频一二三区| 成人三级伦理片| wwwwww.欧美系列| 麻豆91精品91久久久的内涵| 欧美日韩国产免费一区二区| 亚洲理论在线观看| www.视频一区| 国产精品区一区二区三区| 国产一区二区h| 欧美zozo另类异族| 免费成人美女在线观看.| 欧美精品久久天天躁| 亚洲在线免费播放| 色呦呦国产精品| 自拍偷拍国产亚洲| 99热精品国产| 国产精品久久久99| 99精品国产一区二区三区不卡| 欧美国产激情二区三区| 国产福利视频一区二区三区| 久久影院午夜论| 国产揄拍国内精品对白| 精品国产1区2区3区| 激情综合五月婷婷| 精品国产免费久久| 国产麻豆精品久久一二三| 精品88久久久久88久久久| 国产原创一区二区三区| 国产欧美日韩亚州综合 | 91精品国产综合久久福利| 午夜久久久久久| 51久久夜色精品国产麻豆| 偷拍自拍另类欧美| 欧美变态tickle挠乳网站| 国产一区在线观看麻豆| 久久精品在这里| 波多野结衣亚洲| 一区二区三区在线观看欧美| 欧美三级一区二区| 日本大胆欧美人术艺术动态 | 另类小说视频一区二区| 精品日韩一区二区三区| 国产999精品久久| 亚洲欧美综合色| 欧美在线你懂得| 欧美a一区二区| 国产亚洲欧美中文| 91网站在线播放| 午夜a成v人精品| 精品国产免费人成在线观看| www.亚洲激情.com| 亚洲不卡一区二区三区| 欧美成人性福生活免费看| 国产高清精品在线| 亚洲精品免费视频| 日韩写真欧美这视频| 国产精品白丝av| 亚洲精品视频观看| 欧美一区二区三区视频免费| 国产精品18久久久久久久久| 亚洲美腿欧美偷拍| 欧美一个色资源| www.亚洲激情.com| 日韩av电影免费观看高清完整版 | 亚洲自拍偷拍网站| 51精品国自产在线| 成人影视亚洲图片在线| 亚洲国产精品久久艾草纯爱| 精品国产欧美一区二区| 色综合一区二区| 久久aⅴ国产欧美74aaa| 中文字幕视频一区| 日韩欧美你懂的| 91国偷自产一区二区使用方法| 精品一区免费av| 一区二区高清免费观看影视大全| 欧美精品一区二区三区四区| 色婷婷亚洲一区二区三区| 美女任你摸久久| 一区二区久久久久久| 国产日韩成人精品| 91麻豆精品国产91久久久更新时间| 白白色亚洲国产精品| 美国十次综合导航| 樱花草国产18久久久久| 久久精品亚洲精品国产欧美kt∨ | 日韩免费电影一区| 91极品美女在线| 成人午夜激情影院| 青青草国产成人99久久| 亚洲免费视频中文字幕| 久久久久亚洲蜜桃| 欧美精品久久一区| 91麻豆国产在线观看| 国产黄色精品网站| 久国产精品韩国三级视频| 亚洲一区二区三区美女| 国产精品久久久久久久久免费桃花 | 日韩午夜激情电影| 在线视频你懂得一区| 成人av综合一区| 国产一区二区久久| 看电影不卡的网站| 麻豆视频观看网址久久| 婷婷丁香激情综合| 亚洲自拍偷拍麻豆| 综合激情网...| 国产精品区一区二区三| 国产婷婷精品av在线| 欧美精品一区二区三| 91精品国产高清一区二区三区 | 91免费观看视频在线| 成人在线综合网站| 高清在线不卡av| 国产精品一品二品| 国产一区二区在线免费观看| 理论电影国产精品| 蜜桃精品视频在线| 毛片不卡一区二区|