|
-
Aug 30th, 2008, 12:56 PM
#1
Thread Starter
Junior Member
Giving Button Functions?
I don't know if this is the convenient spot to post this thread, but I wonder if anyone can help me on my browser?
I am very new to this, and would like some basic help on how to give my buttons some functions. For example, I want the 'back' button for my browser to go back a page, which is ALT + LEFT. How do I assign "alt + left" for the back button?
-
Aug 30th, 2008, 01:08 PM
#2
Re: Giving Button Functions?
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Aug 30th, 2008, 01:09 PM
#3
Thread Starter
Junior Member
Re: Giving Button Functions?
Like I said, big big beginner
where do I apply that coding, on that button right
and its ALT + left so.. let me try.
-
Aug 30th, 2008, 01:11 PM
#4
Thread Starter
Junior Member
Re: Giving Button Functions?
okay i got this error "Specified repeat count is not valid."
i think it kept clicking it infinity? how can you do it so when you click it does it once
-sry for doublepost
-
Aug 30th, 2008, 01:12 PM
#5
Re: Giving Button Functions?
just put it in your button_click event. doubleclick the button + vb will open the button_click event in your code window
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Aug 30th, 2008, 01:16 PM
#6
Re: Giving Button Functions?
SendKeys.Send("%{LEFT}") specifies to send alt+left to the application with the focus (i.e. your application)
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Aug 30th, 2008, 01:18 PM
#7
Re: Giving Button Functions?
While SendKeys is the way to simulate a certain key combination to your program, I don't think it's the best way here...
I suppose 'my browser' means that you got a webbrowser control on your form? If so, you can simply call it's "GoBack" function. There is no need to use SendKeys in this case.
If you don't have your own browser control but you mean an external browser (internet explorer, whatever) then maybe SendKeys is the way to do this...
-
Aug 30th, 2008, 01:20 PM
#8
Thread Starter
Junior Member
Re: Giving Button Functions?
ok heres what my code lines look like for the button:
Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
SendKeys.Send("%{LEFT}")
End Sub
End Class
when i push f5 to test it, i click the button and nothing happens
shudnt the button be affiliated with the webbrowser?
-
Aug 30th, 2008, 01:21 PM
#9
Thread Starter
Junior Member
Re: Giving Button Functions?
YES a webmaster is what i mean. where is this goback funtion found?
-
Aug 30th, 2008, 01:22 PM
#10
Re: Giving Button Functions?
if sendkeys doesn't work, try NickThissens solution
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Aug 30th, 2008, 01:26 PM
#11
Re: Giving Button Functions?
Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.WebBrowser1.GoBack()
End Sub
-
Aug 30th, 2008, 01:30 PM
#12
Thread Starter
Junior Member
Re: Giving Button Functions?
it works!
THANK YOU EVERYBODY FOR YOUR TIME AND SUPPORT!
-
Aug 30th, 2008, 01:35 PM
#13
Thread Starter
Junior Member
Re: Giving Button Functions?
hmm i come with another problem....
Code:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Me.WebBrowser1.Stop()
End Sub
that doesnt seem to work...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|