Working with forms?

Hi

I have two forms called: frmMain, frmSlave. frmMain has three buttons: button1, button2. frmSlave has a picture box and I would like to be able to change the pictures at run time.

The program should work like this:
1) On the button1 Event frmSlave must be loaded with the picture box picture must be set to picture1.
2) On the button2 Event frmSlave must be hidden and the picture box picture must be set to picture2.

Could you please give me tips on how I can open/close and control other forms within the other form. I would also like the forms to be ShowDialog.


Thanks

Comments

  • : Hi
    :
    : I have two forms called: frmMain, frmSlave. frmMain has three
    : buttons: button1, button2. frmSlave has a picture box and I would
    : like to be able to change the pictures at run time.
    :
    : The program should work like this:
    : 1) On the button1 Event frmSlave must be loaded with the picture box
    : picture must be set to picture1.
    : 2) On the button2 Event frmSlave must be hidden and the picture box
    : picture must be set to picture2.
    :
    : Could you please give me tips on how I can open/close and control
    : other forms within the other form. I would also like the forms to be
    : ShowDialog.
    :
    :
    : Thanks
    :
    Hi. I think this may help with the first portion of your question.

    [code]
    private void button1_Click(object sender, EventArgs e)
    {

    frmSlave objSlave = new frmSlave();
    objSlave.MdiParent = this.MdiParent;
    objSlave.ShowDialog();
    }
    [/code]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion