Multiple forms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sanderpleijers@gmail.com

    Multiple forms

    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 '' axWindowsMediaP layer.Ctlcontro ls.play(); ''
    (= play) command from the FrmMain form to the Fullscreen form?

    Something like:

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

    Can anyone help me with this problem?

    Thnx,
    Sander

    See http://www.informit.com/articles/art...&seqNum=2&rl=1
    for more info about Windows Media Player controls with C#

  • Brian

    #2
    Re: Multiple forms


    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
    "AxWindowsMedia Player.Ctlcontr ols.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.Invoke Play();


    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



    sanderpleijers@ gmail.com wrote:[color=blue]
    > 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 '' axWindowsMediaP layer.Ctlcontro ls.play(); ''
    > (= play) command from the FrmMain form to the Fullscreen form?
    >
    > Something like:
    >
    > (In Mainform)
    > private void button2_Click(o bject sender, EventArgs e)
    > {
    > //Send play command to Fullscreen form
    > }
    >
    > Can anyone help me with this problem?
    >
    > Thnx,
    > Sander
    >
    > See http://www.informit.com/articles/art...&seqNum=2&rl=1
    > for more info about Windows Media Player controls with C#
    >[/color]

    Comment

    Working...