How to return string from a button click handler?

Posted by riad on Stack Overflow See other posts from Stack Overflow or by riad
Published on 2010-05-25T13:34:21Z Indexed on 2010/05/25 13:41 UTC
Read the original article Hit count: 210

Filed under:
|

I need to return a string from a button method .How can i do that?

private string folderPathButton_Click(object sender, EventArgs e)
{
    FolderBrowserDialog folderBrowser = new FolderBrowserDialog();
    folderBrowser.ShowDialog();
    string folderPath = folderBrowser.SelectedPath;                 
    return folderPath;           
}

On that method on button click i get the folder path.Now i need to return it.But this code is not working? Can anybody help me to solve the problem??How can i return the folder path and call it from another method??

© Stack Overflow or respective owner

Related posts about c#

Related posts about winforms