public NavigateBarCaption(NavigateBar tNavigateBar) { navigateBar = tNavigateBar; // Control this.Height = 24; this.Dock = DockStyle.Top; this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.ResizeRedraw, true); // Collapse Button collapseButton = new NavigateBarCollapseButton(navigateBar); this.CollapseMode = true; SetNewPositionForCollapseButton(); collapseButton.Top = (this.Height - collapseButton.Size.Height) / 2; collapseButton.MouseClick += new MouseEventHandler(CollapseButton_MouseClick); // this.Controls.Add(collapseButton); }