H. Itman Posted July 12, 2006 Share Posted July 12, 2006 Hey All I recently made af small program for backup purposes. Now i found out that i needed to convert my ListView into a TreeView, no problem, except that @TABS does not display correctly. In the ListView i used the $LBS_USETABSTOPS style to show @TABS, but i cant find a similar style for TreeView in the help file. I have also searched this forum for almost 6 hours, and still nothing. I tried everything i can possible think of, so i hope that some of you out there might have a solution for my problem. In advance thanks. SciTE version 1.68 AutoIt version 3.1.1.0 ;------------------------------------------------- ; EXAMPLE BEGIN #include <GuiConstants.au3> Opt("GUIOnEventMode", 1) Dim $Text = "My TAB" & @TAB & "Test" ; TAB DISPLAYS WRONG IN TREEVIEW $GUI = GUICreate("TreeView",300,200,-1,-1) $TV_1 = GUICtrlCreateTreeView(5,5,290,155,$TVS_DISABLEDRAGDROP+$TVS_SHOWSELALWAYS+$TVS_CHECKBOXES,$WS_EX_CLIENTEDGE) $TVI = GUICtrlCreateTreeViewitem($Text,$TV_1) $Btn = GUICtrlCreateButton("Exit",5,165,78,20) GUICtrlSetOnEvent($Btn,"Quit") GUISetState() While 1 Sleep(250) WEnd Func Quit() Exit EndFunc ; EXAMPLE END ;------------------------------------------------- Link to comment Share on other sites More sharing options...
Coldburn Posted October 9, 2006 Share Posted October 9, 2006 Ok, first you dont really have a whole lot to go on here but I'm going to take a whak at it. I don't think you understand what @TAB is. It creates an actual ASCII tab character(9), not new menu items. You define $Text as "My TAB -a tab char-> Test". So when you create a tree view item based on $Text, that's exactally what it will display! Each item in the tree view is an object (including the tree view itself), so you'll need to define each one. Here's a little template below to help you get the flow of the tree view items. You really need to study the AutoIt Help for GUICtrlCreateListView. ;- Incomplete Script - $tree = GUICtrlCreateListView ( "text", left, top [, width [, height [, style [, exStyle]]]] ) <-- put in your values $primary1 = GUICtrlCreateTreeViewItem( "Primary 1", $tree) $item_p1_1 = GUICtrlCreateTreeViewItem( "Item 1", $primary1 ) $item_p1_2 = GUICtrlCreateTreeViewItem( "Item 2", $primary1 ) $item_p1_3 = GUICtrlCreateTreeViewItem( "Item 3", $primary1 ) $primary2 = GUICtrlCreateTreeViewItem( "Primary 2", $tree) $item_p2_1 = GUICtrlCreateTreeViewItem( "Item 1", $primary2 ) $item_p2_2 = GUICtrlCreateTreeViewItem( "Item 2", $primary2 ) Link to comment Share on other sites More sharing options...
Rick-O-Shea Posted November 14, 2006 Share Posted November 14, 2006 Coldburn - he's trying to get proper alignment between the two text items. I ran into the same problem today... Does anyone have a solution to this? Thnx! 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