I'm trying to make a File Manager with WinForms. I made a navigation bar, two buttons, one to go back and an other to forward the navigation.
I want to go back navigation when I'm in WebBrowser form and I press BACKSPACE key. Apparently this work fine, but when I want to erase a character renaming a file the BACKSPACE key event is called.
How can I check if are selected files in the WebBrowser and apply the go back navigation only if there aren't ?
private void webBrowser1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Back)
{
//Do only if no selected items in WebBrowser
webBrowser1.GoBack();
}
}