mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-23 07:22:52 +08:00
41 lines
1000 B
C#
41 lines
1000 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace CodeWalker.WinForms
|
|
{
|
|
public partial class TreeViewFix : TreeView
|
|
{
|
|
public TreeViewFix()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
protected override void OnPaint(PaintEventArgs pe)
|
|
{
|
|
base.OnPaint(pe);
|
|
}
|
|
|
|
protected override void WndProc(ref Message m)
|
|
{
|
|
if (m.Msg == 0x203) // double click
|
|
{
|
|
var localPos = PointToClient(Cursor.Position);
|
|
var hitTestInfo = HitTest(localPos);
|
|
if (hitTestInfo.Location == TreeViewHitTestLocations.StateImage)
|
|
m.Result = IntPtr.Zero;
|
|
else
|
|
base.WndProc(ref m);
|
|
}
|
|
else base.WndProc(ref m);
|
|
}
|
|
|
|
}
|
|
}
|