6 Replies - 8022 Views - Last Post: 22 April 2009 - 04:11 PM Rate Topic: -----

#1 Anfrany1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 22-April 09

MP3 Player(Volume Control) wont let me set with trackbar

Posted 22 April 2009 - 01:46 PM

Okay so when I try to have it so when the track bar moves, it updates the volume on the MP3 player but if I don't have a ' before the code I get this error...

EDIT: The code that I have to comment out is
AxWindowsMediaPlayer1.settings.volume = Me.volume2.Value


	Private Sub volume_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles volume2.ValueChanged
		Label2.Text = "Volume: " & volume2.Value & "%"
		AxWindowsMediaPlayer1.settings.volume = Me.volume2.Value
	End Sub

That's the code to change it
Here is the error that I get
An error occurred creating the form. See Exception.InnerException for details.  The error is: Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown.


Any help would be appreciated. Thanks!

This post has been edited by Anfrany1: 22 April 2009 - 01:47 PM


Is This A Good Question/Topic? 0
  • +

Replies To: MP3 Player(Volume Control) wont let me set with trackbar

#2 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2240
  • View blog
  • Posts: 9,411
  • Joined: 29-May 08

Re: MP3 Player(Volume Control) wont let me set with trackbar

Posted 22 April 2009 - 02:05 PM

What values are min and max?
Was This Post Helpful? 0
  • +
  • -

#3 Anfrany1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 22-April 09

Re: MP3 Player(Volume Control) wont let me set with trackbar

Posted 22 April 2009 - 02:29 PM

View PostAdamSpeight2008, on 22 Apr, 2009 - 01:05 PM, said:

What values are min and max?

Min - 0
Max - 100
Was This Post Helpful? 0
  • +
  • -

#4 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2240
  • View blog
  • Posts: 9,411
  • Joined: 29-May 08

Re: MP3 Player(Volume Control) wont let me set with trackbar

Posted 22 April 2009 - 02:42 PM

And what did the inner exception say?
Was This Post Helpful? 0
  • +
  • -

#5 Anfrany1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 22-April 09

Re: MP3 Player(Volume Control) wont let me set with trackbar

Posted 22 April 2009 - 03:26 PM

View PostAdamSpeight2008, on 22 Apr, 2009 - 01:42 PM, said:

And what did the inner exception say?

Inner exception?

Here is the full error
System.InvalidOperationException was unhandled
  Message="An error occurred creating the form. See Exception.InnerException for details.  The error is: Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown."
  Source="uPlay"
  StackTrace:
	   at uPlay.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
	   at uPlay.My.MyProject.MyForms.get_Form1()
	   at uPlay.My.MyApplication.OnCreateMainForm() in C:\Users\Anthony\Documents\Visual Studio 2008\Projects\uPlay\uPlay\My Project\Application.Designer.vb:line 35
	   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
	   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
	   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
	   at uPlay.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
	   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
	   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
	   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
	   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
	   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
	   at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.Windows.Forms.AxHost.InvalidActiveXStateException
	   Message="Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown."
	   Source="AxInterop.WMPLib"
	   StackTrace:
			at AxWMPLib.AxWindowsMediaPlayer.get_settings()
			at uPlay.Form1.volume_ValueChanged(Object sender, EventArgs e) in C:\Users\Anthony\Documents\Visual Studio 2008\Projects\uPlay\uPlay\Form1.vb:line 18
			at System.Windows.Forms.TrackBar.OnValueChanged(EventArgs e)
			at System.Windows.Forms.TrackBar.set_Value(Int32 value)
			at uPlay.Form1.InitializeComponent() in C:\Users\Anthony\Documents\Visual Studio 2008\Projects\uPlay\uPlay\Form1.Designer.vb:line 213
			at uPlay.Form1..ctor()
	   InnerException: 


Was This Post Helpful? 0
  • +
  • -

#6 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2240
  • View blog
  • Posts: 9,411
  • Joined: 29-May 08

Re: MP3 Player(Volume Control) wont let me set with trackbar

Posted 22 April 2009 - 03:56 PM

Post the section of code where this line is called from
 System.Windows.Forms.TrackBar.set_Value


Was This Post Helpful? 0
  • +
  • -

#7 Anfrany1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 22-April 09

Re: MP3 Player(Volume Control) wont let me set with trackbar

Posted 22 April 2009 - 04:11 PM

Where do I put that at?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1