Опять вопрос про toolTip... Как убрать с treeview тултип со значением?
И ещё.. во время движения мыши, как узнать над какой записью курсор?
Private Sub TreeView1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim nTargetNode As Node
Set nTargetNode = TreeView1.HitTest(x, y)
If Not nTargetNode Is Nothing Then
Debug.Print nTargetNode.Text
End If
End Sub
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const TVS_NOTOOLTIPS = &H80
...
Dim i As Long
...
' NOTOOLTIP
i = GetWindowLong(TreeView1.hwnd, GWL_STYLE)
SetWindowLong TreeView1.hwnd, GWL_STYLE, i Or TVS_NOTOOLTIPS
APMpc писал(а):Извините, что влажу в чужую тему, но как проверить, существует ли Node в TreeView с определенным значением Key?
Private Sub Form_Load()
TreeView1.Nodes.Add , , "Test", "Test"
Print Tests(TreeView1.Nodes, "Test")
End Sub
Function Tests(ColObj As Nodes, elem) As Boolean
On Error Resume Next
Dim elem2 As Node
Err.Clear
Set elem2 = ColObj(elem)
Tests = Err.Number = 0
End Function
function nodeexists(tree as treeview, nodekey as string) as boolean
nodeexists = true
for each node in tree.nodes
if node.key = nodekey then exit function
next node
nodeexists = false
end function
Сейчас этот форум просматривают: AhrefsBot и гости: 13