Wooltown Posted May 29, 2008 Share Posted May 29, 2008 Can anyone give an example how to put a tooltip on a TreeViewItem ? I have tried a lot of combinations, but no success. Link to comment Share on other sites More sharing options...
JRowe Posted May 30, 2008 Share Posted May 30, 2008 expandcollapse popup#include <GUIConstants.au3> #include <GuiTreeView.au3> $Form1 = GUICreate("Form1", 136, 180, 193, 125) $TreeView1 = GUICtrlCreateTreeView(8, 8, 121, 161, BitOR($TVS_HASBUTTONS,$TVS_HASLINES,$TVS_LINESATROOT,$TVS_DISABLEDRAGDROP,$TVS_SHOWSELALWAYS,$TVS_INFOTIP,$WS_GROUP,$WS_TABSTOP)) $TreeView1_0 = GUICtrlCreateTreeViewItem("1", $TreeView1) $TreeView1_1 = GUICtrlCreateTreeViewItem("1", $TreeView1_0) $TreeView1_2 = GUICtrlCreateTreeViewItem("2", $TreeView1_0) $TreeView1_3 = GUICtrlCreateTreeViewItem("3", $TreeView1_0) $TreeView1_4 = GUICtrlCreateTreeViewItem("4", $TreeView1_0) $TreeView1_5 = GUICtrlCreateTreeViewItem("5", $TreeView1_0) $TreeView1_6 = GUICtrlCreateTreeViewItem("2", $TreeView1) $TreeView1_7 = GUICtrlCreateTreeViewItem("3", $TreeView1) $TreeView1_8 = GUICtrlCreateTreeViewItem("4", $TreeView1) $TreeView1_9 = GUICtrlCreateTreeViewItem("5", $TreeView1) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch TreeViewToolTip(GUICtrlGetHandle($TreeView1)) WEnd Func TreeViewToolTip($TreeViewHandle) $HotTreeviewItem = TreeItemFromPoint($TreeViewHandle) If $HotTreeviewItem <> 0 Then $MousePos = GUIGetCursorInfo () ToolTip("TreeView Item ID is " & $HotTreeviewItem, $MousePos[0], $MousePos[1], $MousePos[0] & "," & $MousePos[1], 2) ElseIf $HotTreeviewItem = 0 Then ToolTip("") EndIf EndFunc Func TreeItemFromPoint($hWnd) Local $tMPos = _WinAPI_GetMousePos(True, $hWnd) Return _GUICtrlTreeView_HitTestItem($hWnd, DllStructGetData($tMPos, 1), DllStructGetData($tMPos, 2)) EndFunc Thanks to Siao for the TreeItemFromPoint function. That gets tooltips per specific items for ya. There's some funkiness there, though [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
Wooltown Posted May 30, 2008 Author Share Posted May 30, 2008 Thanks, exactly what I was looking for ! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now