You must Sign In to post a response.
  • Category: .NET

    How to confirm if any file opened or not with openfiledialog

    Hi Team,
    I am trying to open a file using browse button and open file dialog. when file is opened by the feature I'm writting the file name along with path in one textbox. till this point everything is g=fine. Now how to know whether the file is opened or not and it is ready to use the data in that file.
    Thanks in advance.

    Regards,
    sreeja
  • #768161
    When you call "ShowDialog" it returns a DialogResult

    Simply check if it's ok or cancel

    DialogResult result =myDialog.ShowDialog();

    if (result == DialogResult.OK)
    {
    //OK
    }
    else if (result == DialogResult.Cancel)
    {
    //User pressed cancel
    }
    http://goo.gl/Qf1irP


  • Sign In to post your comments