![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Hi RandomCoder,
I am just before finishing a small todo-tree application so I came up this question some time ago. As I was not able to select individual images for each node, I added a small character to the beginning of the node text, indicating that this node has additional information. It looks something like this (see attachment). Maybe you use this as an indication for read/unread messages. specci48 @Erel: You can add this missing feature to the wishlist for future updates... ![]() |
|
||||
|
I hadn't thought of that but it's exactly the kind of work-a-round I was after.
Thanks for sharing it with us. Erel, if we could have individual images for each node some time in a future release then that would be better still ![]() Thanks, RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD. Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD. "Defeat never comes to any man until he admits it."Josephus Daniels |
|
||||
|
TreeView supports different images for different nodes.
For example: Code:
Sub Globals
'Declare the global variables here.
End Sub
Sub App_Start
Form1.Show
tree.New1("form1",10,10,200,300)
node.New1
tree.ImageMode = true
tree.AddImage1(AppPath & "\smiley.gif")
tree.AddImage1(AppPath & "\folder.bmp")
tree.AddImage1(AppPath & "\openfolder.bmp")
node.Value = tree.AddNewNode("first")
node.ImageIndex = 0
node.SelectedImageIndex = 0
node.Value = tree.AddNewNode("second")
node.ImageIndex = 1
node.SelectedImageIndex = 1
node.Value = tree.AddNewNode("third")
node.ImageIndex = 2
node.SelectedImageIndex = 2
End Sub
|
|
||||
|
Erel, this is great news, I've just played with the code and it works
![]() What I hadn't realised from the "Folder Chooser" example (which others can find here... Treeview - different pics for nodes? Post #4) was that you can redefine the node. I had misunderstood that this would add another level to the tree, but that was because in the folder chooser you have actually set two nodes, Node1.New1 and Node2.New1. I think that the penny has finaly dropped for me ![]() Thanks once again for your support. Regards, RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD. Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD. "Defeat never comes to any man until he admits it."Josephus Daniels |
|
||||
|
After your helpful post #4 I thought that I'd grasped how to make the tree control work the way I wanted but for some reason I'm still having problems
![]() This is the snippet of code I'm struggling with... Code:
Sub UpdateInbox TreeViewInbox.RemoveAllNodes For MSG = 0 To TBLSMSInbox.RowCount-1 If TblSMSInbox.Cell( "READ" , MSG ) = False Then TreeViewNode1.Value = TreeViewInbox.AddNewNode( TblSMSInbox.Cell( "FROM" , MSG ) & " -- " & Time( TblSMSInbox.Cell( "DATE" , MSG ) ) & " , " & Date( TblSMSInbox.Cell( "DATE" , MSG ) ) ) TreeViewNode2.Value = TreeViewNode1.AddNewNode( TblSMSInbox.Cell( "BODY" , MSG ) ) TreeViewInbox.ImageIndex = 0 TreeViewInbox.SelectedImageIndex = 0 Else TreeViewNode1.Value = TreeViewInbox.AddNewNode( TblSMSInbox.Cell( "FROM" , MSG ) & " -- " & Time( TblSMSInbox.Cell( "DATE" , MSG ) ) & " , " & Date( TblSMSInbox.Cell( "DATE" , MSG ) ) ) TreeViewNode2.Value = TreeViewNode1.AddNewNode( TblSMSInbox.Cell( "BODY" , MSG ) ) TreeViewInbox.ImageIndex = 1 TreeViewInbox.SelectedImageIndex = 1 End If Next TreeViewInbox.ExpandAll End Sub I've checked that the Else block of code is being used my inserting a MsgBox in there and I've double checked that image 1 is working by changing the other image 0 commands. For some reason I just cannot get the tree view to loop through my table and display an image the depicts whether the message has been read or not. Am I just being really thick today??? ![]() Regards, RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD. Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD. "Defeat never comes to any man until he admits it."Josephus Daniels |
|
||||
|
You should change the nodes images not the treeview images.
try this: Code:
Sub UpdateInbox TreeViewInbox.RemoveAllNodes For MSG = 0 To TBLSMSInbox.RowCount-1 If TblSMSInbox.Cell( "READ" , MSG ) = False Then TreeViewNode1.Value = TreeViewInbox.AddNewNode( TblSMSInbox.Cell( "FROM" , MSG ) & " -- " & Time( TblSMSInbox.Cell( "DATE" , MSG ) ) & " , " & Date( TblSMSInbox.Cell( "DATE" , MSG ) ) ) TreeViewNode2.Value = TreeViewNode1.AddNewNode( TblSMSInbox.Cell( "BODY" , MSG ) ) TreeViewNode1.ImageIndex = 0 TreeViewNode1.SelectedImageIndex = 0 Else TreeViewNode1.Value = TreeViewInbox.AddNewNode( TblSMSInbox.Cell( "FROM" , MSG ) & " -- " & Time( TblSMSInbox.Cell( "DATE" , MSG ) ) & " , " & Date( TblSMSInbox.Cell( "DATE" , MSG ) ) ) TreeViewNode2.Value = TreeViewNode1.AddNewNode( TblSMSInbox.Cell( "BODY" , MSG ) ) TreeViewNode1.ImageIndex = 1 TreeViewNode1.SelectedImageIndex = 1 End If Next TreeViewInbox.ExpandAll End Sub |
|
||||
![]() After loads of attempts at getting this working I just have, but as always, you have beaten me to it ![]() Sorry for wasting your time. Regards, RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD. Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD. "Defeat never comes to any man until he admits it."Josephus Daniels |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tree View - Help | Cableguy | Questions & Help Needed | 18 | 07-19-2008 12:43 PM |
| Another problem with tree view | RandomCoder | Questions & Help Needed | 8 | 02-28-2008 11:36 AM |
| Registry to Tree View | willisgt | Questions & Help Needed | 0 | 02-20-2008 04:17 PM |
| Context Menu and Tree View. | RandomCoder | Questions & Help Needed | 4 | 02-18-2008 04:35 PM |
| Canīt view whole Website with PPC Browser | Smurfy2000 | Forum Discussion | 3 | 02-13-2008 08:08 AM |