| View previous topic :: View next topic |
| Author |
Message |
I'm C.H. Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Dec 2006 Posts: 1000 Location: Sweden
|
Posted: Fri Jan 16, 2009 9:19 am Post subject: [Vb.net] Event Happening Each ... [Solved] |
|
|
I wanna know how to make an event happen each time a value is changed.
What I'm trying to do is a Checkbox which will change frame each time A HScrollbar changes it's value(when it's scrolled) if the checkbox is checked.
_________________
Last edited by I'm C.H. on Sun Jan 18, 2009 5:08 am; edited 1 time in total |
|
| Back to top |
|
 |
Skyone Grandmaster Cheater
Reputation: 0
Joined: 10 Sep 2006 Posts: 508
|
Posted: Fri Jan 16, 2009 9:39 am Post subject: |
|
|
???
Last edited by Skyone on Wed Dec 23, 2009 9:08 am; edited 7 times in total |
|
| Back to top |
|
 |
I'm C.H. Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Dec 2006 Posts: 1000 Location: Sweden
|
Posted: Sat Jan 17, 2009 7:10 am Post subject: |
|
|
Anyone who knows?
_________________
|
|
| Back to top |
|
 |
Stonehenge Master Cheater
Reputation: 0
Joined: 03 Oct 2008 Posts: 280 Location: Unknown Jumphole
|
Posted: Sat Jan 17, 2009 8:36 am Post subject: |
|
|
Put your scroll bar on the form and double click on it which will take you to the code for the form and into a sub for when the scroll bar changes, then insert this code:
| Code: |
If CheckBox1.Checked = True Then
Dim frame As Integer = HScrollBar1.Value()
End If |
where CheckBox1 is the name of your check box, and HScrollBar1 is the name of your scroll bar.
You can actually do whatever you want between the If/End If, but I thought I might show you how to access the number property of the scroll bar all in one fell swoop, thus if you were using it to control the frame of a flash object, you would do this:
| Code: |
If CheckBox1.Checked = True Then
Dim frame As Integer = HScrollBar1.Value()
AxShockwaveFlash1.FrameNum() = frame
End If |
Change the max value for the scroll bar in it's properties if you want. And remember to put all this code in the space that comes up when you double click on the scroll bar, leaving you with a final product of this:
| Code: | Private Sub HScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles HScrollBar1.Scroll
If CheckBox1.Checked = True Then
Dim frame As Integer = HScrollBar1.Value()
AxShockwaveFlash1.FrameNum() = frame
End If
End Sub |
_________________
|
|
| Back to top |
|
 |
|