Re: Read Only Property

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi MikeD

Thanks for your post, as you will most likely know this is not my own
code so I have struggled a bit with understanding how all of it works.
I have tried to insert a code line in the GetAllDrivesFolders procedure
but they failed as I could not find which variable held the number.
Can you offer some more help on this please.

Ron

"MikeD" wrote:


"LondonLad" <LondonLad@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CE873E72-8DAC-4B03-8AA5-3AA5210C3BCC@xxxxxxxxxxxxxxxx
Hi
I use the code below in a treeview the code works without error, I would
like
to change the final display on repeated searches.
Example:-
When the Treeview displays the Drives I have 5 A,C,D,E and F if I click
say
F first after the search lblSearch.Caption has 215 OK, if I then do
another
search say on C this has 5000 but the display shows 5215 it adds the two.
I would like it to only display the last drive search 5000 but because of
the fact that tvSearch.Nodes.Count is read only I have not been able to
solve
this problem. Can you help please?

Private Sub tvSearch_Click()

Dim nodX As Node
cmdSearch.Enabled = False

'show a wait message for long searches
lblSearch.Caption = "Searching drive " & tvSearch.SelectedItem & " for
folders ... please wait"
Me.MousePointer = 13 'vbHourglass
DoEvents

'identify the selected node
Set nodX = tvSearch.SelectedItem

'verify that it is valid>
If (UCase$(Right$(nodX.Key, 3)) = "DIR") And (nodX.Children = 0) Then
GetAllDrivesFolders tvSearch, nodX
End If

'subtract NoOfDrives because initial drives loaded
'should not be counted as a folder
lblSearch.Caption = "Total folders displayed : " & tvSearch.Nodes.Count -
NoOfDrives
Me.MousePointer = 0
End Sub

Why don't you have your GetAllDrivesFolders procedure return the number
found? This would just be a simple counter added to that procedure. That
way, you don't have to rely on Nodes.Count.

Or, clear the nodes from previous search so the Treeview only has nodes for
the folders found by the current search. If that's not what you want, then
the caption "Total folders displayed", IMO, *should* be the count of
everything found by all searches.

--
Mike



.



Relevant Pages

  • Re: XP Search wont work on my C drive
    ... "Display the contents of system folders" is selected. ... network drives and it returns files that I would expect it to. ...
    (microsoft.public.windowsxp.basics)
  • Re: XP Search wont work on my C drive
    ... In Control Panel -> Folder Options: ... "Display the contents of system folders" is selected. ... network drives and it returns files that I would expect it to. ...
    (microsoft.public.windowsxp.basics)
  • Re: XP Search wont work on my C drive
    ... Does your c drive display in Windows Explorer? ... "Display the contents of system folders" is selected. ... network drives and it returns files that I would expect it to. ...
    (microsoft.public.windowsxp.basics)
  • Re: XP Search wont work on my C drive
    ... "Display the contents of system folders" is selected. ... network drives and it returns files that I would expect it to. ...
    (microsoft.public.windowsxp.basics)
  • Re: XP Search wont work on my C drive
    ... "Display the contents of system folders" is selected. ... network drives and it returns files that I would expect it to. ...
    (microsoft.public.windowsxp.basics)