我是C sharp中的新手。我创建了一个垂直滚动条(VScrollBar)。我想改变滚动条Backcolor的颜色。因为它是从Control继承的,所以当我改变颜色时它不会产生任何效果。 在InitializeComponents() - >垂直滚动条颜色不变
this.vScrollBar1 = new System.Windows.Forms.VScrollBar();
this.vScrollBar1.Location = new System.Drawing.Point(472, -41);
this.vScrollBar1.Name = "vScrollBar1";
this.vScrollBar1.Size = new System.Drawing.Size(17, 80);
this.vScrollBar1.TabIndex = 15;
this.panel1.Controls.Add(vScrollBar1);
在Constructor->
this.vScrollBar1.BackColor= Color.Black; //<--here is the back color property
this.Invalidate();
有什么建议?
请张贴您的代码 – VladL 2014-09-13 10:10:04
I在initializecompotents() - > 1.vScrollBar.BackColor = Color.Black; 2.vScrollBar.Invalidate(); – WildPoisoned 2014-09-13 10:15:39
将来在问题中编写代码。我们很容易阅读它,并且您不会被拒绝投票。希望我的回答能帮助你。 – mybirthname 2014-09-13 10:53:24