The "quick fix" is to call DoEvents()
after setting the TextBox:
textBox1.Text = dir;
Application.DoEvents();
// ... rest of the code ...
The proper fix, however, is to place that code into a background thread. If you use the BackgroundWorker() control you can use ReportProgress() and the associated ProgressChanged() event to update the TextBox.