Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > Prevent keypreview on a Webbrowser Control
 

Prevent keypreview on a Webbrowser Control

- I am using the Webbrowser control in my Windows forms application...
- My problem appear when the user press "Backspace", the Webbrowser navigates back to the last shown page...
- Can I disable the "Backspace" or prevent the Webbrowser from seeing the pressed keys??

Thanks
Betamoo  Thursday, July 23, 2009 12:46 PM

Hi,

You can set AllowNavigation property of Webbrowser to false.

You can also try this way.

Use a arraylist to maintain the previous Links. If the arraylist has contained the Url, this will not allow the user to go back previous page.

http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/baae18c0-1886-41cb-9f47-4a8fee72464a

Complex way should be filter the backspace message. Besides, IE and other browser can also use backspace to go back previous page. Use Backspace to go back maybe not a bad function.

Best regards,

Ling Wang


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Tuesday, July 28, 2009 8:53 AM

Hi,

You can set AllowNavigation property of Webbrowser to false.

You can also try this way.

Use a arraylist to maintain the previous Links. If the arraylist has contained the Url, this will not allow the user to go back previous page.

http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/baae18c0-1886-41cb-9f47-4a8fee72464a

Complex way should be filter the backspace message. Besides, IE and other browser can also use backspace to go back previous page. Use Backspace to go back maybe not a bad function.

Best regards,

Ling Wang


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Tuesday, July 28, 2009 8:53 AM

You can use google to search for other answers

Custom Search

More Threads

• PocketVision fix...
• .NET Updater Component
• Disable Auto-update?
• Wanted: Any Terrarium files
• Seeking a simple program ~ text to binary converter
• Run time Create controls
• Is there an IssueVision guide?
• uninstall msi application
• Localization form
• ProgressBar Thread