listbox自绘滚动条完美版源码,没有漏洞

其实也没有什么太多技术含量,就是一个代码搞定的,高手在的话我们可以多交流下QQ皮肤。主要代码先贴出来。

鼠标滚动,滚动条跟随滚蛋,自己原创,百度搜不到的!!

 

 1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Linq;
7 using System.Text;
8 using System.Windows.Forms;
9 using System.Runtime.InteropServices;
10 using System.Drawing.Drawing2D;
11 using LM.CLibrary.Controls;
12
13 namespace LMWinApp
14 {
15 public partial class Form1 : Form
16 {
17 public Form1()
18 {
19 InitializeComponent();
20 for (int i = 0; i < 40; i++)
21 {
22 if (i >= 9)
23 lmListBox1.Items.Add((i + 1).ToString() + ". 我要去西藏 乌兰托娅" + i.ToString());
24 else
25 lmListBox1.Items.Add((i + 1).ToString() + ". 我要去西藏 乌兰托娅" + i.ToString());
26 }
27 lmvScrollBar1.Maximum = lmListBox1.Items.Count;
28 lmvScrollBar1.ThumbHeight = lmListBox1.Height / lmListBox1.ItemHeight;
29 LM.CLibrary.Controls.LMVScrollBar v = new LMVScrollBar();
30 lmListBox1.MouseWheel += new MouseEventHandler(_BindControl_MouseWheel);
31 }
32
33 private void lmvScrollBar1_ValueChange(object sender, EventArgs e)
34 {
35
36 }
37 public void _BindControl_MouseWheel(object sender, MouseEventArgs e)
38 {
39 lmvScrollBar1.Focus();
40
41 this.Invalidate();
42 }
43
44 }
45 }

www.8timer.com/AlongQQ/6/LMWinApp.rar

posted @ 2012-01-20 15:54  学坏  阅读(646)  评论(1编辑  收藏  举报