private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(CollapsiblePanel));

            this.collapsiblePanelImageList = new ImageList(this.components);
            this.titlePanel            = new Panel();
            this.titleTableLayoutPanel = new TableLayoutPanel();
            this.togglingImage         = new PictureBox();
            this.lblPanelTitle         = new Label();
            this.contentPanel          = new ContentPanel();
            this.titlePanel.SuspendLayout();
            this.titleTableLayoutPanel.SuspendLayout();
            ((ISupportInitialize)this.togglingImage).BeginInit();
            base.SuspendLayout();
            this.collapsiblePanelImageList.ImageStream      = (ImageListStreamer)componentResourceManager.GetObject("collapsiblePanelImageList.ImageStream");
            this.collapsiblePanelImageList.TransparentColor = Color.Transparent;
            this.collapsiblePanelImageList.Images.SetKeyName(0, "ExpandIcon.jpg");
            this.titlePanel.BackColor             = Color.DarkGray;
            this.titlePanel.BackgroundImage       = Resources.titleBackground;
            this.titlePanel.BackgroundImageLayout = ImageLayout.Stretch;
            this.titlePanel.Controls.Add(this.titleTableLayoutPanel);
            this.titlePanel.Dock                   = DockStyle.Top;
            this.titlePanel.Location               = new Point(0, 0);
            this.titlePanel.Name                   = "titlePanel";
            this.titlePanel.Size                   = new Size(150, 24);
            this.titlePanel.TabIndex               = 0;
            this.titleTableLayoutPanel.BackColor   = Color.Transparent;
            this.titleTableLayoutPanel.ColumnCount = 2;
            this.titleTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 24f));
            this.titleTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f));
            this.titleTableLayoutPanel.Controls.Add(this.togglingImage, 0, 0);
            this.titleTableLayoutPanel.Controls.Add(this.lblPanelTitle, 1, 0);
            this.titleTableLayoutPanel.Dock     = DockStyle.Fill;
            this.titleTableLayoutPanel.Location = new Point(0, 0);
            this.titleTableLayoutPanel.Name     = "titleTableLayoutPanel";
            this.titleTableLayoutPanel.RowCount = 1;
            this.titleTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100f));
            this.titleTableLayoutPanel.Size     = new Size(150, 24);
            this.titleTableLayoutPanel.TabIndex = 2;
            this.titleTableLayoutPanel.Click   += this.ToggleState;
            this.togglingImage.Anchor           = AnchorStyles.None;
            this.togglingImage.BackColor        = Color.Transparent;
            this.togglingImage.Image            = Resources.ExpandedIcon;
            this.togglingImage.Location         = new Point(7, 7);
            this.togglingImage.Name             = "togglingImage";
            this.togglingImage.Size             = new Size(10, 10);
            this.togglingImage.SizeMode         = PictureBoxSizeMode.StretchImage;
            this.togglingImage.TabIndex         = 0;
            this.togglingImage.TabStop          = false;
            this.togglingImage.Click           += this.ToggleState;
            this.lblPanelTitle.Anchor           = AnchorStyles.Left;
            this.lblPanelTitle.AutoEllipsis     = true;
            this.lblPanelTitle.AutoSize         = true;
            this.lblPanelTitle.BackColor        = Color.Transparent;
            this.lblPanelTitle.Font             = new Font("Segoe UI Semibold", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.lblPanelTitle.ForeColor        = Color.WhiteSmoke;
            this.lblPanelTitle.Location         = new Point(27, 4);
            this.lblPanelTitle.Name             = "lblPanelTitle";
            this.lblPanelTitle.Size             = new Size(59, 15);
            this.lblPanelTitle.TabIndex         = 1;
            this.lblPanelTitle.Text             = "Panel title";
            this.lblPanelTitle.Click           += this.ToggleState;
            this.contentPanel.Location          = new Point(0, 24);
            this.contentPanel.Margin            = new Padding(2);
            this.contentPanel.Name     = "contentPanel";
            this.contentPanel.Size     = new Size(150, 126);
            this.contentPanel.TabIndex = 1;
            base.AutoScaleDimensions   = new SizeF(96f, 96f);
            base.AutoScaleMode         = AutoScaleMode.Dpi;
            base.Controls.Add(this.contentPanel);
            base.Controls.Add(this.titlePanel);
            base.Name = "CollapsiblePanel";
            this.titlePanel.ResumeLayout(false);
            this.titleTableLayoutPanel.ResumeLayout(false);
            this.titleTableLayoutPanel.PerformLayout();
            ((ISupportInitialize)this.togglingImage).EndInit();
            base.ResumeLayout(false);
            base.PerformLayout();
        }
Exemple #2
0
 private void InitializeComponent()
 {
     this.components = (IContainer) new Container();
       ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (CollapsiblePanel));
       this.collapsiblePanelImageList = new ImageList(this.components);
       this.titlePanel = new Panel();
       this.titleTableLayoutPanel = new TableLayoutPanel();
       this.togglingImage = new PictureBox();
       this.lblPanelTitle = new Label();
       this.contentPanel = new ContentPanel();
       this.titlePanel.SuspendLayout();
       this.titleTableLayoutPanel.SuspendLayout();
       ((ISupportInitialize) this.togglingImage).BeginInit();
       this.SuspendLayout();
       this.collapsiblePanelImageList.ImageStream = (ImageListStreamer) componentResourceManager.GetObject("collapsiblePanelImageList.ImageStream");
       this.collapsiblePanelImageList.TransparentColor = Color.Transparent;
       this.collapsiblePanelImageList.Images.SetKeyName(0, "ExpandIcon.jpg");
       this.titlePanel.BackColor = Color.DarkGray;
       this.titlePanel.BackgroundImage = (Image) Resources.titleBackground;
       this.titlePanel.BackgroundImageLayout = ImageLayout.Stretch;
       this.titlePanel.Controls.Add((Control) this.titleTableLayoutPanel);
       this.titlePanel.Dock = DockStyle.Top;
       this.titlePanel.Location = new Point(0, 0);
       this.titlePanel.Name = "titlePanel";
       this.titlePanel.Size = new Size(150, 24);
       this.titlePanel.TabIndex = 0;
       this.titleTableLayoutPanel.BackColor = Color.Transparent;
       this.titleTableLayoutPanel.ColumnCount = 2;
       this.titleTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 24f));
       this.titleTableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f));
       this.titleTableLayoutPanel.Controls.Add((Control) this.togglingImage, 0, 0);
       this.titleTableLayoutPanel.Controls.Add((Control) this.lblPanelTitle, 1, 0);
       this.titleTableLayoutPanel.Dock = DockStyle.Fill;
       this.titleTableLayoutPanel.Location = new Point(0, 0);
       this.titleTableLayoutPanel.Name = "titleTableLayoutPanel";
       this.titleTableLayoutPanel.RowCount = 1;
       this.titleTableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100f));
       this.titleTableLayoutPanel.Size = new Size(150, 24);
       this.titleTableLayoutPanel.TabIndex = 2;
       this.titleTableLayoutPanel.Click += new EventHandler(this.ToggleState);
       this.togglingImage.Anchor = AnchorStyles.None;
       this.togglingImage.BackColor = Color.Transparent;
       this.togglingImage.Image = (Image) Resources.ExpandedIcon;
       this.togglingImage.Location = new Point(7, 7);
       this.togglingImage.Name = "togglingImage";
       this.togglingImage.Size = new Size(10, 10);
       this.togglingImage.SizeMode = PictureBoxSizeMode.StretchImage;
       this.togglingImage.TabIndex = 0;
       this.togglingImage.TabStop = false;
       this.togglingImage.Click += new EventHandler(this.ToggleState);
       this.lblPanelTitle.Anchor = AnchorStyles.Left;
       this.lblPanelTitle.AutoSize = true;
       this.lblPanelTitle.BackColor = Color.Transparent;
       this.lblPanelTitle.Font = new Font("Segoe UI Semibold", 9f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
       this.lblPanelTitle.ForeColor = Color.WhiteSmoke;
       this.lblPanelTitle.Location = new Point(27, 4);
       this.lblPanelTitle.Name = "lblPanelTitle";
       this.lblPanelTitle.Size = new Size(59, 15);
       this.lblPanelTitle.TabIndex = 1;
       this.lblPanelTitle.Text = "Panel title";
       this.lblPanelTitle.Click += new EventHandler(this.ToggleState);
       this.contentPanel.Location = new Point(0, 24);
       this.contentPanel.Margin = new Padding(2);
       this.contentPanel.Name = "contentPanel";
       this.contentPanel.Size = new Size(150, 126);
       this.contentPanel.TabIndex = 1;
       this.AutoScaleDimensions = new SizeF(96f, 96f);
       this.AutoScaleMode = AutoScaleMode.Dpi;
       this.Controls.Add((Control) this.contentPanel);
       this.Controls.Add((Control) this.titlePanel);
       this.Name = "CollapsiblePanel";
       this.titlePanel.ResumeLayout(false);
       this.titleTableLayoutPanel.ResumeLayout(false);
       this.titleTableLayoutPanel.PerformLayout();
       ((ISupportInitialize) this.togglingImage).EndInit();
       this.ResumeLayout(false);
       this.PerformLayout();
 }