2013-04-29 20 views
0

有什么方法可以更改Trackbar的拇指背景吗?我使用C#winform。
只有Trackbar的背景可以更改,所以如何更改或设置拇指中的某些内容?更改Trackbar的拇指背景

任何答复赞赏。

回答

0

只见项目:

http://www.codeproject.com/Articles/7974/A-variation-on-the-default-TrackBar

并添加它的图片,让用户选择:

/// <summary> 
    /// Set Image of Trackbar's thumb 
    /// </summary> 
    /// <param name="value"></param> 
    /// <returns></returns> 
    [Description("Set the picture of the thumb")] 
    [Category("Image")] 
    public Image Picture 
    { 
     set 
     { 
      myPic = value; 
     } 
     get { return myPic; } 
    } 

而且使用的TextureBrush让画面人民shoose是图像刷:

TextureBrush newBrush = new TextureBrush(myPic); 
if (myPic != null) 
{ 
     g.FillRegion(newBrush, new Region(PaintPath)); 
     newBrush.Dispose(); 
} 
else 
{ 
     g.FillRegion(bgBrush, new Region(PaintPath)); 
     bgBrush.Dispose(); 
} 

只有一个问题,即im agebrush是瓷砖风格,

如果我让它不是瓷砖风格,它可能会解决我的questrion。