austin615
|
  |
| Joined: 02 Jan 2013 |
| Total Posts: 125 |
|
|
| 08 Feb 2012 12:36 PM |
Why wont this work, Ive tried everything :C
Private Sub OptionsBtn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OptionsBtn1.Click If Music = 1 Then My.Computer.Audio.Stop() Me.OptionsBtn1.Text = "Music? -OFF-" Music = 0 End If If Music = 0 Then My.Computer.Audio.Play(My.Resources.Hail_to_the_Chief, AudioPlayMode.Background) Me.OptionsBtn1.Text = "Music? -ON-" Music = 1 End If End Sub |
|
|
| Report Abuse |
|
|
austin615
|
  |
| Joined: 02 Jan 2013 |
| Total Posts: 125 |
|
|
| 08 Feb 2012 12:38 PM |
| Oh ya and, at the top of the script I have "Music" defined as 1 |
|
|
| Report Abuse |
|
|
noobkid
|
  |
| Joined: 17 Sep 2007 |
| Total Posts: 649 |
|
|
| 08 Feb 2012 12:40 PM |
"Music = 0 End If If Music = 0 Then" Doesn't that mean that you can't turn it off |
|
|
| Report Abuse |
|
|
austin615
|
  |
| Joined: 02 Jan 2013 |
| Total Posts: 125 |
|
|
| 08 Feb 2012 12:49 PM |
| I want it to every time you click it, it alternates between on and off. |
|
|
| Report Abuse |
|
|
| |
|
|
| 08 Feb 2012 01:25 PM |
I think he means like a button that toggles between on/off.
~I script Awesome sauce to go with my spaghetti code |
|
|
| Report Abuse |
|
|
austin615
|
  |
| Joined: 02 Jan 2013 |
| Total Posts: 125 |
|
|
| 08 Feb 2012 01:26 PM |
@MrGamesNWatch
Yes I do mean that :D |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2012 01:27 PM |
Do you have visual studio,
Also, paste the whole script if you could, |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2012 01:29 PM |
noobkid is right.
Private Sub OptionsBtn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OptionsBtn1.Click If Music = 1 Then My.Computer.Audio.Stop() Me.OptionsBtn1.Text = "Music? -OFF-" Music = 0 Else My.Computer.Audio.Play(My.Resources.Hail_to_the_Chief, AudioPlayMode.Background) Me.OptionsBtn1.Text = "Music? -ON-" Music = 1 End If End Sub |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2012 01:30 PM |
So at one point you do have something along the lines of...
Dim Music as integer = 0
Amiright? |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2012 01:31 PM |
| I'm assuming Music is a global integer. We'll just have to wait and see what OP says. ^_^ |
|
|
| Report Abuse |
|
|
austin615
|
  |
| Joined: 02 Jan 2013 |
| Total Posts: 125 |
|
|
| 08 Feb 2012 02:03 PM |
| And I do say :P Yes, I have Music defined as a "Public" (Global) Interger and I would like it to switch on and off... |
|
|
| Report Abuse |
|
|
austin615
|
  |
| Joined: 02 Jan 2013 |
| Total Posts: 125 |
|
| |
|
|
| 08 Feb 2012 03:52 PM |
| Javascript > VBScript, no? |
|
|
| Report Abuse |
|
|
| |
|
|
| 08 Feb 2012 09:15 PM |
| Wait they're the same thing right? VB and VBScript |
|
|
| Report Abuse |
|
|