Beispiel #1
0
        private void settings2Btn_Click(object sender, EventArgs e)
        {
            nTreeViewEx1.Suspend();
            nTreeViewEx1.Nodes.Clear();

            nTreeViewEx1.NormalState.TextRenderingHint           = TextRenderingHint.SystemDefault;
            nTreeViewEx1.HotState.TextRenderingHint              = TextRenderingHint.SystemDefault;
            nTreeViewEx1.SelectedState.TextRenderingHint         = TextRenderingHint.SystemDefault;
            nTreeViewEx1.HotSelectedState.TextRenderingHint      = TextRenderingHint.SystemDefault;
            nTreeViewEx1.PressedState.TextRenderingHint          = TextRenderingHint.SystemDefault;
            nTreeViewEx1.InactiveSelectedState.TextRenderingHint = TextRenderingHint.SystemDefault;

            NLightUIItemVisualState normalState = new NLightUIItemVisualState();

            normalState.FillInfo.Gradient1       = Color.Orange;
            normalState.FillInfo.Gradient2       = Color.Yellow;
            normalState.FillInfo.GradientStyle   = Nevron.UI.WinForm.Controls.GradientStyle.SigmaBell;
            normalState.StrokeInfo.SmoothingMode = SmoothingMode.AntiAlias;
            normalState.StrokeInfo.Rounding      = 3;
            normalState.StrokeInfo.Color         = Color.Black;
            normalState.TextFillInfo.FillStyle   = FillStyle.Solid;
            normalState.TextFillInfo.Color       = Color.Black;

            NLightUIItemVisualState hotState = new NLightUIItemVisualState();

            hotState.FillInfo.Gradient1       = Color.Yellow;
            hotState.FillInfo.Gradient2       = Color.Orange;
            hotState.FillInfo.GradientStyle   = Nevron.UI.WinForm.Controls.GradientStyle.Vista;
            hotState.StrokeInfo.SmoothingMode = SmoothingMode.AntiAlias;
            hotState.StrokeInfo.PenWidth      = 2;
            hotState.StrokeInfo.DashStyle     = DashStyle.Dash;
            hotState.StrokeInfo.Color         = Color.Black;
            hotState.TextFillInfo.Color       = Color.Black;

            NLightUIItemVisualState selectedState = new NLightUIItemVisualState();

            selectedState.FillInfo.Gradient1       = Color.Orange;
            selectedState.FillInfo.Gradient2       = Color.Black;
            selectedState.StrokeInfo.SmoothingMode = SmoothingMode.AntiAlias;
            selectedState.StrokeInfo.Rounding      = 3;
            selectedState.StrokeInfo.Color         = Color.Black;
            selectedState.TextFillInfo.Color       = Color.White;

            nTreeViewEx1.IndicatorStyle         = TreeViewIndicatorStyle.OnLeft;
            nTreeViewEx1.ItemImageSize          = new NSize(32, 32);
            nTreeViewEx1.HotState.Image         = m_Images[3];
            nTreeViewEx1.SelectedState.Image    = m_Images[4];
            nTreeViewEx1.HotSelectedState.Image = m_Images[5];
            nTreeViewEx1.TrackHotSelectedState  = false;

            NTreeNode child1, child2, child3;

            for (int i = 1; i < 21; i++)
            {
                child1                 = new NTreeNode();
                child1.Text            = "Tree node with local Hot visual state";
                child1.Image           = m_Images[1];
                child1.CommonIndicator = (CommonIndicator)i;
                child1.SetVisualState(hotState, ItemVisualState.Hot);

                for (int j = 1; j < 21; j++)
                {
                    child2                 = new NTreeNode();
                    child2.Text            = "Tree node with local Normal visual state";
                    child2.Image           = m_Images[1];
                    child2.CommonIndicator = (CommonIndicator)j;
                    child2.SetVisualState(normalState, ItemVisualState.Normal);

                    for (int k = 1; k < 21; k++)
                    {
                        child3                 = new NTreeNode();
                        child3.Text            = "Tree node with local Selected visual state";
                        child3.Image           = m_Images[1];
                        child3.CommonIndicator = (CommonIndicator)k;
                        child3.SetVisualState(selectedState, ItemVisualState.Selected);

                        child2.Nodes.Add(child3);
                    }

                    child1.Nodes.Add(child2);
                }

                nTreeViewEx1.Nodes.Add(child1);
            }

            this.nTreeViewEx1.Nodes[0].Expand();
            nTreeViewEx1.Resume(true);
        }