示例#1
0
        private Guna2ToggleSwitch addSwTextPic()
        {
            Guna2ToggleSwitch swTextPic = new Guna2ToggleSwitch();

            swTextPics.Add(swTextPic);

            swTextPic.Checked = true;
            swTextPic.CheckedState.BorderColor      = System.Drawing.Color.FromArgb(((int)(((byte)(94)))), ((int)(((byte)(148)))), ((int)(((byte)(255)))));
            swTextPic.CheckedState.FillColor        = System.Drawing.Color.FromArgb(((int)(((byte)(94)))), ((int)(((byte)(148)))), ((int)(((byte)(255)))));
            swTextPic.CheckedState.InnerBorderColor = System.Drawing.Color.White;
            swTextPic.CheckedState.InnerColor       = System.Drawing.Color.White;
            swTextPic.CheckedState.Parent           = swTextPic;
            animation.SetDecoration(swTextPic, BunifuAnimatorNS.DecorationType.None);
            swTextPic.Location = new System.Drawing.Point(551, 39);
            swTextPic.ShadowDecoration.Parent = swTextPic;
            swTextPic.Size = new System.Drawing.Size(35, 20);
            swTextPic.UncheckedState.BorderColor      = System.Drawing.Color.FromArgb(((int)(((byte)(125)))), ((int)(((byte)(137)))), ((int)(((byte)(149)))));
            swTextPic.UncheckedState.FillColor        = System.Drawing.Color.FromArgb(((int)(((byte)(125)))), ((int)(((byte)(137)))), ((int)(((byte)(149)))));
            swTextPic.UncheckedState.InnerBorderColor = System.Drawing.Color.White;
            swTextPic.UncheckedState.InnerColor       = System.Drawing.Color.White;
            swTextPic.UncheckedState.Parent           = swTextPic;
            swTextPic.CheckedChanged += new System.EventHandler(this.swTextPic_CheckedChanged);
            swTextPic_CheckedChanged(swTextPic, null);

            return(swTextPic);
        }
示例#2
0
        private void swTextPic_CheckedChanged(object sender, EventArgs e)
        {
            Guna2ToggleSwitch sw = sender as Guna2ToggleSwitch;
            int indexSelect      = swTextPics.FindIndex(x => x == sw);

            lblTextPics[indexSelect].Text = sw.Checked ? "Texts" : "Images";
            visibleText(txtContents[indexSelect], ptcContents[indexSelect], btnOpens[indexSelect], btnClipboards[indexSelect], sw.Checked);
        }