Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8135807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:32:12+00:00 2026-06-06T10:32:12+00:00

I am once again a bit stuck in my practising. I want an MP3

  • 0

I am once again a bit stuck in my practising.
I want an MP3 file to play when i open my program – I can do that, i got music.
I also want a checkbox which allows to pause the music – But either I’m very tired, or the thing won’t work – Nothing happens when i check/uncheck it. I’ve done it like this:

public void PlayPause(int Status)
     {
        WMPLib.WindowsMediaPlayer wmp = new WMPLib.WindowsMediaPlayer();
        switch (Status)
        {
            case 0:
                wmp.URL = "Musik.mp3";
                break;
            case 1:
                wmp.controls.play();
                break;
            case 2:
                wmp.controls.pause();
                break;
        }
    }

Upon opening the program, the method is called with case 0. Music plays. All good.
However this doesn’t work, and i don’t get why, as it is pretty simple code.

        public void checkBox1_CheckedChanged(object sender, EventArgs e)
    {
        if (checkBox1.Checked == true)
        {
            PlayPause(2);
        }
        else if (checkBox1.Checked == false)
        {
            PlayPause(1);
        }
    }

Any idea as to why checking the checkbox doesn’t pause/unpause the music?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:32:14+00:00Added an answer on June 6, 2026 at 10:32 am

    You’re instantiating a completely new WindowsMediaPlayer object each time you call that PlayPause function.

    Thus, when you call pause later on, you’re pausing nothing.

    You need to hold or pass a reference to that WMP object around, so that you’re operating on the same one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Once again I was in a design review, and encountered the claim that the
I'm having a bit of a trouble (once again...) with Excel VBA. I just
Once again, I'm questioning a longstanding belief. Until today, I believed that the alignment
Once again I've inherited someone else's system which is a bit of a mess.
Once again, I'm at a loss with IE7 on this one. I'm making a
Once again I'm receiving structs via UDP from a C++ programm, Now I ported
Once again, lists are boggling my mind. <div id=headbottom> <ul id=headnavbutton> <li id=button1 class=headnavbutton></li>
Once again my silliness has struck. I would like to thank everyone who helped
Once again a question about the garbage collector in actionscript-3: If I have a
Once again I'm doing Java graphics (Graphics2D) but I noticed there is no Polygon.Double

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.