0

I have a couple of list boxes on a Win form, the main one shows duplicates folders (when found) the 2nd one I want to show the current directory in a directory recursion.

The way the List box seems to work is that it shows the root item e.g. Temp but as it delves into the directory it still shows the root item, the only way I can see the rest of the structure is to use the vertical scroll bar at program completion.

It's as though I need to List box to fill from bottom to top.

The code I'm using is the answered comment here Issues with directory get directories access denied exceptions and long paths

Community
  • 1
  • 1
  • What is your problem? Scrolling to the bottom? Paths missing? Refresh of listbox while still filling it?? – TaW Sep 27 '14 at 14:34
  • Hi There, The list box doesn't show the recursion as it's happening, if I use the scroll bar then I can see the paths it's visited, Perhaps I'm using the wrong control, would a text box be better to show each path visited because it doesn't fill like a list box. –  Sep 28 '14 at 22:41
  • _show the recursion as it's happening,_ OK, now that sounds like a problem of displaying the data while they still are being added, right? Try to insert a `listBox1.Refresh()`! – TaW Sep 28 '14 at 22:48
  • @TaW I've already tried listbox.refresh() and listbox.Update() I have a listbox which has been shrunk down to a single line, which may be the problem. –  Sep 29 '14 at 05:48

1 Answers1

0

Found what I was looking for

listBoxPath.TopIndex = listBoxPath.Items.Count - 1;

  • Hehe, just when I want to point you to [this](http://stackoverflow.com/questions/8796747/how-to-scroll-to-bottom-of-listbox).. – TaW Sep 29 '14 at 08:11