Пример #1
0
        ActiveLabel makeNewLabel(String name, Object item, Image icon)
        {
            ActiveLabel aLabel = new ActiveLabel("     " + name, item);

            //
            // activeLabel1
            //
            //aLabel.BackColor = System.Drawing.SystemColors.Control;

            if (icon != null)
            {
                aLabel.Image = icon;
            }
            aLabel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;

            aLabel.Location  = new System.Drawing.Point(0, _labelHeight * _nameList.Count + 1000);
            aLabel.Name      = name;
            aLabel.Size      = new System.Drawing.Size(100, _labelHeight);
            aLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;

            aLabel.MouseDown += new MouseEventHandler(aLabel_MouseDown);
            aLabel.Dock       = System.Windows.Forms.DockStyle.Bottom;
            //aLabel.DragLeave +=new EventHandler(aLabel_DragLeave);
            aLabel.Parent = P_Back;
            P_Back.SuspendLayout();
            P_Back.Controls.Add(aLabel);

            P_Back.ResumeLayout();

            return(aLabel);
        }
Пример #2
0
        void B_Title_Click(object sender, EventArgs e)
        {
            int height = 0;

            if (_isPanelVisible)
            {
                P_Back.Visible = false;
                P_Back.SetBounds(0, 0, P_Back.Width, 0, BoundsSpecified.Height);
                B_Title.Image = Properties.Resources.tree_close;
            }
            else
            {
                P_Back.Visible = true;
                height         = _items[_nameList[0]].Height;
                P_Back.SetBounds(0, 0, P_Back.Width, height, BoundsSpecified.Height);
                B_Title.Image = Properties.Resources.tree_open;
            }
            _isPanelVisible = !_isPanelVisible;
            this.Height     = B_Title.Height + height;
        }
Пример #3
0
 void resizePanel()
 {
     P_Back.SuspendLayout();
     P_Back.SetBounds(0, 0, 0, _items.Count * (_labelHeight + 1), BoundsSpecified.Height);
     P_Back.ResumeLayout();
 }