日期:2014-05-18  浏览次数:20956 次

哪位兄弟可知道怎么重绘treeview的滚动条?
滚动条漂亮一点,类似QQ


------解决方案--------------------
这个很难的。

一般是用HOOK,截取消息来绘。比较麻烦。
------解决方案--------------------
比较可行的方法是自己从Control派生,自己绘制 自己实现滚动条的功能。。代替系统提供的滚动条。
------解决方案--------------------
你可以参考一下这个。

http://www.setoutsoft.cn/skinscroll.htm

看了应该就会做了,是用很曲折的办法实现。
------解决方案--------------------
up!~
------解决方案--------------------
滚动条可以自己设置CSS样式:
 html {
 scrollbar-face-color:#E0FFFF;
 scrollbar-highlight-color:#E0FFFF;
 scrollbar-3dlight-color:#20B2AA;
 scrollbar-darkshadow-color:#000099;
 scrollbar-Shadow-color:#5F9EA0;
 scrollbar-arrow-color:#0000FF;
 scrollbar-track-color:#ADD8E6;
}
你自己多试试得到你想要的效果!
------解决方案--------------------
up~
------解决方案--------------------
等待老大出现呀
------解决方案--------------------
winform飘过
------解决方案--------------------
没试出来
------解决方案--------------------
自己定控件, 实现滚动条的功能, 替换系统默认的比较实际...

处理非客户区域很痛苦的...

-_-!!!
------解决方案--------------------
VB鼠标滚动事件,没有样式。

Private Const PM_REMOVE = &H1
Private Type POINTAPI
x As Long
y As Long
End Type
Private Type Msg
hWnd As Long
Message As Long
wParam As Long
lParam As Long
time As Long
pt As POINTAPI
End Type
Private Declare Function PeekMessage Lib "user32" Alias "PeekMessageA" (lpMsg As Msg ByVal hWnd As Long ByVal wMsgFilterMin As Long ByVal wMsgFilterMax As Long ByVal wRemoveMsg As Long) As Long
Private Declare Function WaitMessage Lib "user32" () As Long
Private bCancel As Boolean
Private Const WM_MOUSEWHEEL = 522
 
Private Sub ProcessMessages()
Dim Message As Msg
Do While Not bCancel
WaitMessage 'Wait For message and...
If PeekMessage(Message Me.hWnd WM_MOUSEWHEEL WM_MOUSEWHEEL PM_REMOVE) Then '...when the mousewheel is used...
If Message.wParam < 0 Then '...scroll up...
Me.Top = Me.Top + 240
Else '... or scroll down
Me.Top = Me.Top - 240
End If
End If
DoEvents
Loop
End Sub
 
Private Sub Form_Load()
Me.AutoRedraw = True
Me.Print "Please use now mouse wheel to move this form."
Me.Show
ProcessMessages
End Sub
 
Private Sub Form_Unload(Cancel As Integer)
bCancel = True
End Sub
 
------解决方案--------------------

 用最新的WPF来做。非常容易实现。
------解决方案--------------------
jf.haha
------解决方案--------------------
其实MSDN上有一个画滚动条的例子,如果你愿意,你完全可以不使用示例中的ScrollBarRenderer而自己来绘制:
C# code

using System;
using System.Drawing;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;

namespace ScrollBarRendererSample
{
    class Form1 : Form
    {
        public Form1()
            : base()
        {
            this.Size = new Size(500, 500);

            CustomScrollBar Bar1 = new CustomScrollBar();
            Bar1.Location = new Point(50, 100);
            Bar1.Size = new Size(200, 20);

            Controls.Add(Bar1);
        }

        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.Run(ne