By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,815 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,815 IT Pros & Developers. It's quick & easy.

Making a WebBrowser and would like to know how to set up arrow key scrolling

P: 1
I am making a web browser and want to be able to scroll the page with arrow keys.
Feb 11 '13 #1

✓ answered by IronRazer

Hello ty1445,
As long as the webbrowser property (ScrollBarsEnabled) is set to True and the webbrowser has focus it should scroll using the arrow keys. Maybe it is loosing focus after pressing a button or another control. If so you can set focus back to it using :

Example : If a Button is pressed
Expand|Select|Wrap|Line Numbers
  1.     Private Sub Button1_DoSomething_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1_DoSomething.Click
  2.         WebBrowser1.Focus()
  3.  
  4.         'Do your commands
  5.  
  6.     End Sub
  7.  
If the commands in the button event causes another control to get focus then put the (Webbrowser.Focus) after "Do your commands".

Share this Question
Share on Google+
1 Reply


IronRazer
P: 83
Hello ty1445,
As long as the webbrowser property (ScrollBarsEnabled) is set to True and the webbrowser has focus it should scroll using the arrow keys. Maybe it is loosing focus after pressing a button or another control. If so you can set focus back to it using :

Example : If a Button is pressed
Expand|Select|Wrap|Line Numbers
  1.     Private Sub Button1_DoSomething_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1_DoSomething.Click
  2.         WebBrowser1.Focus()
  3.  
  4.         'Do your commands
  5.  
  6.     End Sub
  7.  
If the commands in the button event causes another control to get focus then put the (Webbrowser.Focus) after "Do your commands".
Feb 11 '13 #2

Post your reply

Sign in to post your reply or Sign up for a free account.