Пример #1
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            Tools.Selectionset ss = this.treeView1.SelectedNode.Tag as Tools.Selectionset;
            try
            {
                Color c = ColorTranslator.FromHtml(ss.color.ToString());
                createColorRectangle(c);
            }
            catch
            {
                Color c = ColorTranslator.FromHtml("#F0F0F0");
                createColorRectangle(c);
            }

            try
            {
                this.transparencySlider.Value = int.Parse(ss.transparency.ToString());
                this.Transparency.Text        = transparencySlider.Value.ToString();
            }
            catch
            {
                this.transparencySlider.Value = 0;
                this.Transparency.Text        = transparencySlider.Value.ToString();
            }
        }
Пример #2
0
        private void transparencySlider_Scroll(object sender, EventArgs e)
        {
            this.Transparency.Text = transparencySlider.Value.ToString();


            try
            {
                Tools.Selectionset ss = this.treeView1.SelectedNode.Tag as Tools.Selectionset;
                ss.transparency = transparencySlider.Value;
            }
            catch { }
        }
Пример #3
0
        private void ApplyColorToTree(Tools.Selectionset item, TreeNode treeNode)
        {
            var   colorString = item.color;
            Color color       = new Color();

            if (colorString != null)
            {
                color = ColorTranslator.FromHtml(colorString.ToString());
            }
            else
            {
                color = ColorTranslator.FromHtml("#FFFFFF");
            }


            treeNode.BackColor = color;
        }
Пример #4
0
        private void colorbutton_Click(object sender, EventArgs e)
        {
            this.colorDialog1.ShowDialog();
            Tools.Selectionset ss = this.treeView1.SelectedNode.Tag as Tools.Selectionset;
            Color c = this.colorDialog1.Color;

            ss.color = ColorTranslator.ToHtml(c);
            createColorRectangle(c);

            var   colorString = ss.color;
            Color color       = new Color();

            if (colorString != null)
            {
                color = ColorTranslator.FromHtml(colorString.ToString());
            }
            else
            {
                color = ColorTranslator.FromHtml("#FFFFFF");
            }


            this.treeView1.SelectedNode.BackColor = color;
        }