Hi all,

I have a file open dialog box which allows the user to select a file from the drive. I need to display the path and file name of the selected file dynamically as and when the user selects in the title bar of the form.

For eg:

C:\Documents and Settings\My Documents\My Pictures

In the abv example i need to dynamically display each of these when user selects.

c:\Documents and Settings
c:\Documents and Settings\My Documents
c:\Documents and Settings\My Documents\My Pictures etc..

Can you help me..???

Thanks in advance.

Solved:

Answer is :

var diag = new OpenFileDialog(); var diagResult = diag.ShowDialog(); if(diagResult == System.Windows.Forms.DialogResult.OK) { this.Text = diag.FileName; }