Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Wpf

Wpf

Scheduled Pinned Locked Moved WPF
questioncsharpwpfhelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    radhika 5
    wrote on last edited by
    #1

    Hi, I Have one question... i have parent window and child window.. in parent window i opened child window and in child window am playing selected multiple songs from the list box so i want to apply those selected songs as background music to the parent window .. how? and what should i do ? please help me.. thanks in advance.

    A 1 Reply Last reply
    0
    • R radhika 5

      Hi, I Have one question... i have parent window and child window.. in parent window i opened child window and in child window am playing selected multiple songs from the list box so i want to apply those selected songs as background music to the parent window .. how? and what should i do ? please help me.. thanks in advance.

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      Have a look at this article - Multiple Window Interface for WPF[^]. This should give you an idea on how to display multiple windows. You can play music in WPF using the SoundPlayer class[^].

      Too much of heaven can bring you underground Heaven can always turn around Too much of heaven, our life is all hell bound Heaven, the kill that makes no sound

      R 1 Reply Last reply
      0
      • A Abhinav S

        Have a look at this article - Multiple Window Interface for WPF[^]. This should give you an idea on how to display multiple windows. You can play music in WPF using the SoundPlayer class[^].

        Too much of heaven can bring you underground Heaven can always turn around Too much of heaven, our life is all hell bound Heaven, the kill that makes no sound

        R Offline
        R Offline
        radhika 5
        wrote on last edited by
        #3

        already am playing multiple songs in child window...i wanna to play those songs in parent window ...

        S 1 Reply Last reply
        0
        • R radhika 5

          already am playing multiple songs in child window...i wanna to play those songs in parent window ...

          S Offline
          S Offline
          Saksida Bojan
          wrote on last edited by
          #4

          There are sevral ways you can send complex information from child. If you use modal mode you can always loog into child while variable is stil accsessible.

          if (true)
          {
          ChildForm frm = new ChildForm();
          frm.ShowDialog(this); // Modal accsess
          MessageBox.Show(frm.StringToGet();
          }
          // MessageBox.Show(frm.StringToGet(); // This is outside scope of frm. Here form no longer exsist

          You can use static class, so that class does not need to be intilaized and can be accsessd from any Form.

          public static class staticClass
          {
          static staticClass() // static class constructior
          {
          SomeText = "Intalized in constructior";
          }
          static ~staticClass(){} // destructor of static class

          public static String SomeText;
          }

          // parentForm
          if (true)
          {
          MessageBox.Show(staticClass.SomeText); // returns Intalized in constructior
          ChildForm.ShowDialog();
          MessageBox.Show(staticClass.SomeText); // returns other string that was changed in child form
          }

          And the third option is to pass a reference to a class or to a variable. This one is the most complex. But the static class should be the best option if first option is not enough.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups