例如:
在属性浏览器中设置:
设计器自动生成如下代码:
在Form类中:
private MyControlLibrary.ScrollBar TextScrollBar;
在InitializeComponent()中:
this.TextScrollBar.BackColor = System.Drawing.Color.White; this.TextScrollBar.EnterColor = System.Drawing.SystemColors.ControlDark; this.TextScrollBar.Location = new System.Drawing.Point(664, 44); this.TextScrollBar.MinSlideBarLenght = 30; this.TextScrollBar.Name = "TextScrollBar"; this.TextScrollBar.PressedColor = System.Drawing.SystemColors.ControlDarkDark; this.TextScrollBar.Size = new System.Drawing.Size(10, 323); this.TextScrollBar.TabIndex = 18; this.TextScrollBar.TextBox = this.TextBox_Receive; this.TextScrollBar.WakedColor = System.Drawing.SystemColors.ControlLight; |
效果图: