DBCHM/DBChm/TreeViewEnhanced.cs

24 lines
682 B
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DBCHM
{
/// <summary>
/// 在使用treeview控件过程中会碰到
/// 当快速点击checkbox时checkbox选中状态和实际状态不符并且不会触发aftercheck事件
/// 造成此问题的原因是:快速点击识别为双击事件。
/// </summary>
public class TreeViewEnhanced : TreeView
{
protected override void WndProc(ref Message m)
{
if (m.Msg == 0x203) { m.Result = IntPtr.Zero; }
else base.WndProc(ref m);
}
}
}