This repository has been archived on 2025-11-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
AUTS_OLD/UTS_Core/UTSModule/Station/TreeViewEx.vb

28 lines
933 B
VB.net
Raw Normal View History

2024-03-11 16:32:52 +08:00

Imports System.Drawing
Imports System.Windows.Forms
Namespace UTSModule.Station
Public Class TreeViewEx
Inherits TreeView
Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = &H203 Then
Dim tvhti As TreeViewHitTestInfo = HitTest(New Point(CType(m.LParam, Integer)))
If tvhti IsNot Nothing AndAlso tvhti.Location = TreeViewHitTestLocations.StateImage Then
m.Result = IntPtr.Zero
tvhti.Node.Checked = Not tvhti.Node.Checked
Return
End If
ElseIf m.Msg = &H204 Then
Dim tvhti As TreeViewHitTestInfo = HitTest(New Point(CType(m.LParam, Integer)))
If tvhti IsNot Nothing Then
SelectedNode = tvhti.Node
End If
End If
MyBase.WndProc(m)
End Sub
End Class
End NameSpace