View Single Post
  #7 (permalink)  
Old 02-08-2008, 05:01 PM
RandomCoder's Avatar
RandomCoder RandomCoder is offline
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 485
Awards Showcase
Beta Tester 
Total Awards: 1
Default Why won't this work now???

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
When the READ column is True, then the tree view should display image 1, but it doesn't, it continues to show image 0.
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
Reply With Quote