Home All Groups Group Topic Archive Search About
Author
9 May 2007 11:32 AM
AVL
hi,

i've used a  filedialog ox on my winform...
I want the system to pop up a message when the user doens't selects any
file...
how can i do this validation...any help

Author
9 May 2007 4:50 PM
Michael Nemtsev
Hello AVL,

if(openFileDialog1.ShowDialog() == DialogResult.OK)
{
    if (string.IsNullOrEmpty(openFileDialog1.FileName) )
    {
        // No file selected
        MessageBox.Show("You've selected nothing");
    }
}


---
WBR,  Michael  Nemtsev [.NET/C# MVP]. 
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

A> hi,
A>
A> i've used a  filedialog ox on my winform...
A> I want the system to pop up a message when the user doens't selects
A> any
A> file...
A> how can i do this validation...any help

AddThis Social Bookmark Button