Wpf
-
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.
-
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.
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
-
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
-
already am playing multiple songs in child window...i wanna to play those songs in parent window ...
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 exsistYou 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 classpublic 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.