Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
* * * * * 1 votes

Important! Error with music!

import

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1 ChrisZakos

ChrisZakos

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 12 January 2013 - 08:27 PM

Hello, I'am trying to find out how to make a visual studio program play music on start up. I also would like to add a little check box that pauses the music. Any kind of information would be great! I'am almost finished with my program. Google has been no help to me. I think google hates me.

EDIT: I figured it out, However because the buttons on my program make noise the music stops when the button make a noise, Is there any way to fix this?

This was my post from another forum but nobody was willing to help me.

Here is the source:

Public Class Form1
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
	    Shell("Minecraft.exe")
    End Sub
    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
	    Shell("TechnicLauncher.exe")
    End Sub
    Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
	    Shell("MC SOUNDS.exe")
    End Sub
    Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
	    Shell("mcedit.exe")
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
	    Process.Start(Environment.ExpandEnvironmentVariables("%appdata%\.minecraft\texturepacks"))
    End Sub
    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
	    Shell("Minecraft_Server.exe")
    End Sub
    Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
	    Shell("SkinTheft.exe")
    End Sub
    Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
	    Shell("Launch.bat")
    End Sub
    Private Sub Button9_Click(sender As Object, e As EventArgs)
    End Sub
    Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles Button1.MouseEnter

	    My.Computer.Audio.Play(My.Resources.losticks1, AudioPlayMode.Background)
    End Sub
    Private Sub Button3_Click_3(sender As Object, e As EventArgs) Handles Button3.MouseEnter

	    My.Computer.Audio.Play(My.Resources.losticks1, AudioPlayMode.Background)
    End Sub
    Private Sub Button2_Click_2(sender As Object, e As EventArgs) Handles Button2.MouseEnter

	    My.Computer.Audio.Play(My.Resources.losticks1, AudioPlayMode.Background)
    End Sub
    Private Sub Button4_Click_4(sender As Object, e As EventArgs) Handles Button4.MouseEnter

	    My.Computer.Audio.Play(My.Resources.losticks1, AudioPlayMode.Background)
    End Sub
    Private Sub Button5_Click_5(sender As Object, e As EventArgs) Handles Button5.MouseEnter

	    My.Computer.Audio.Play(My.Resources.losticks1, AudioPlayMode.Background)
    End Sub
    Private Sub Button6_Click_6(sender As Object, e As EventArgs) Handles Button6.MouseEnter

	    My.Computer.Audio.Play(My.Resources.losticks1, AudioPlayMode.Background)
    End Sub
    Private Sub Button7_Click_7(sender As Object, e As EventArgs) Handles Button7.MouseEnter

	    My.Computer.Audio.Play(My.Resources.losticks1, AudioPlayMode.Background)
    End Sub
    Private Sub Button8_Click_8(sender As Object, e As EventArgs) Handles Button8.MouseEnter

	    My.Computer.Audio.Play(My.Resources.losticks1, AudioPlayMode.Background)
    End Sub
    Private Sub Label1_Click(sender As Object, e As EventArgs)
    End Sub
    Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
	    Try
		    System.Diagnostics.Process.Start("http://www.planetminecraft.com/member/zakoschris/")
	    Catch
		    'Code to handle the error.
	    End Try
    End Sub
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
	    My.Computer.Audio.Play(My.Resources.**, AudioPlayMode.BackgroundLoop)
							  
    End Sub
End Class

Edited by ChrisZakos, 12 January 2013 - 08:29 PM.


#2 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts

Posted 13 January 2013 - 09:48 AM

what about this video tutorial on how to add sound to your buttons (rather than playing it yourself) ;)




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download