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

转载于:https://www.cnblogs.com/xuehuai/archive/2012/01/20/2327971.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值