当前位置:网站首页>C # WinForm listview control has no scroll bar and has written an extension control by itself
C # WinForm listview control has no scroll bar and has written an extension control by itself
2022-06-22 04:33:00 【mb60b79a6396b63】
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
namespace PosCommonCls
{
public class ListViewEx : ListView
{
//public delegate void ScrollEventHandler(object sender, EventArgs e);
public event EventHandler HScroll;
public event EventHandler VScroll;
public ListViewEx()
{
}
const int WM_HSCROLL = 0x0114;
const int WM_VSCROLL = 0x0115;
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_HSCROLL)
{
OnHScroll(this, new EventArgs());
}
else if (m.Msg == WM_VSCROLL)
{
OnVScroll(this, new EventArgs());
}
base.WndProc(ref m);
}
virtual protected void OnHScroll(object sender, EventArgs e)
{
if (HScroll != null)
HScroll(this, e);
}
virtual protected void OnVScroll(object sender, EventArgs e)
{
if (VScroll != null)
VScroll(this, e);
}
}
}
Only events can be triggered here , Unfortunately, there is no way to return the specific dragged value , I need to deal with it myself
边栏推荐
- Chapter VIII programmable interface chip and application [microcomputer principle]
- 插入排序
- 树的存储结构
- Case driven: a detailed guide from getting started to mastering shell programming
- When the move protocol beta is in progress, the ecological core equity Momo is divided
- Lightweight CNN design skills
- Interaction between C language and Lua (practice 3)
- [从零开始学习FPGA编程-39]:进阶篇 - 语法-硬件模块的单元测试:仿真激励、testbench
- Popular science of source code encryption technology
- Solutions pour l'écran bleu idea
猜你喜欢

Systematic arrangement | how many children's shoes have forgotten to be done carefully before the model development (practical operation)

Odoo Development Manual (I) the second day of contact with odoo

Interaction between C language and Lua (practice 2)

Windows10 cannot access LAN shared folder

插入排序

冒泡排序

WPF DataContext usage (2)

Get the specified row content in Oracle rownum and row_ number()

Researcher of Shangtang intelligent medical team interprets organ image processing under intelligent medical treatment

順序錶的基本操作
随机推荐
Yum command
fastadmin列表多图预览(放大预览,轮播)一行代码
Tencent side
Basic operation of sequence table
What is the value of the FC2 new domain name? How to resolve to a website?
Bubble sort
拦截器的具体概念
Introduction to AWS elastic Beanstalk
The beta version of move protocol is stable, and it is temporarily decided to expand the scale of the prize pool
"Defi moral paradox" behind solend farce
Golang為什麼不推薦使用this/self/me/that/_this
[从零开始学习FPGA编程-39]:进阶篇 - 语法-硬件模块的单元测试:仿真激励、testbench
Es cannot work, circuitbreakingexception
Learning signal integrity from scratch -- 7-si analysis and simulation
Cloud function realizes fuzzy search function
哈夫曼树
TCL Huaxing released the world's first 0.016hz ultra-low frequency OLED wearable device screen
Go learning notes
Interaction between C language and Lua (practice 2)
Digital economy Wang Ning teaches you how to correctly choose short-term investment