Multiple forms

  • Thread starter Thread starter sanderpleijers
  • Start date Start date
S

sanderpleijers

Hi,


Im using 2 forms. The first form is called FrmMain. The second form has
windows media player in it with controls. Its named: Fullscreen.

Now, how can i send a '' axWindowsMediaPlayer.Ctlcontrols.play(); ''
(= play) command from the FrmMain form to the Fullscreen form?

Something like:

(In Mainform)
private void button2_Click(object sender, EventArgs e)
{
//Send play command to Fullscreen form
}

Can anyone help me with this problem?

Thnx,
Sander

See http://www.informit.com/articles/article.asp?p=101752&seqNum=2&rl=1
for more info about Windows Media Player controls with C#
 
There are probably a couple of ways of doing this.
My first thought is that you could have a method on the Fullscreen class
called InvokePlay(). This method would perform
"AxWindowsMediaPlayer.Ctlcontrols.play()".

Now, FrmMain would need a reference to the instance of Fullscreen so it
can call the InvokePlay() method.

So something like this code:


Fullscreen fsObject = (somehow get a reference)
fsObject.InvokePlay();


How you get a reference to your Fullscreen object depends on how you are
building your application. You might pass it as part of the FrmMain's
constructor.

Hopefully this gives you something to go on...

--Brian
 
Back
Top