Note that there are some explanatory texts on larger screens.

plurals
  1. POget value from child from to parent form
    primarykey
    data
    text
    <p>i have 2 form in my media player project i have make object of from1 (parent form) and by that get value from form1 in form3. but i also need to get value of a variable from form3 to form1. but the problem is that when i make the object of form3 in form1 like this </p> <pre><code> Form3 m_child; public Form1(Form3 frm3) { InitializeComponent(); m_child = frm3; } </code></pre> <p>it shows the error in the <strong>program.cs</strong> that <strong>from1 does not contain a constructor that contain 0 argument</strong>. i know i have to pass there a parameter in <code>Application.Run(new Form1());</code> </p> <p>but what i should pass i have no idea. plz help if is there any solution or any other way to get the value from child to parent form. </p> <p>this is my code for form3 now i want to use value of smileplay, surpriseplay ,sadplay,normalplay,ambiguousplay in form1</p> <pre><code> Form1 m_parent; public Form3(Form1 frm1) { InitializeComponent(); m_parent = frm1; } private void Form3_Load(object sender, EventArgs e) { WMPLib.IWMPPlaylistArray allplaylist= m_parent.axWindowsMediaPlayer1.playlistCollection.getAll(); for (int litem = 0; litem &lt; allplaylist.count; litem++) { smilecombo.Items.Add( allplaylist.Item(litem).name); surprisecombo.Items.Add(allplaylist.Item(litem).name); sadcombo.Items.Add(allplaylist.Item(litem).name); normalcombo.Items.Add(allplaylist.Item(litem).name); ambiguouscombo.Items.Add(allplaylist.Item(litem).name); } } private void savebtn_Click(object sender, EventArgs e) { WMPLib.IWMPPlaylist smileplay= m_parent.axWindowsMediaPlayer1.playlistCollection.getByName(smilecombo.SelectedItem.ToString()).Item(0); WMPLib.IWMPPlaylist surpriseplay = m_parent.axWindowsMediaPlayer1.playlistCollection.getByName(surprisecombo.SelectedItem.ToString()).Item(0); WMPLib.IWMPPlaylist sadplay = m_parent.axWindowsMediaPlayer1.playlistCollection.getByName(sadcombo.SelectedItem.ToString()).Item(0); WMPLib.IWMPPlaylist normalplay = m_parent.axWindowsMediaPlayer1.playlistCollection.getByName(normalcombo.SelectedItem.ToString()).Item(0); WMPLib.IWMPPlaylist ambiguousplay = m_parent.axWindowsMediaPlayer1.playlistCollection.getByName(ambiguouscombo.SelectedItem.ToString()).Item(0); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload