How to show a ABOUT Form????????

Hello Everyone:
I use C# want to Create a Project. In my project. there are two
forms. One is main form, and another is a about form. In the about
form there are some information about my project. such as author's
information, product support and so on.
Now, I add a button in the main form, I want that if the user click
the button. It will show the about form . In button's event . the code
like this:
{
about.show();
}
but it doesn't work, if in Delphi. It will be work.
After that, I search the msdn. I know that there is a method called
AddOwnedForm(); so I coded the code like below:
{
Form cs =new Form();
this.AddOwnedForm (cs);
cs.Show();
}
This can show a new Form , but it is not the about form....
What I should do? I'm very sorry for my English , I 'm from China.

Re: How to show a ABOUT Form???????? by Jeff

Jeff
Mon Mar 17 10:23:28 CDT 2008

You should just be able to do this in the main form's button click event
handler:

private void buttonAbout_Click(object sender, EventArgs e)
{
new about().ShowDialog();
}

Jeff Hopper

"Delphiscn" <Delphiscn@gmail.com> wrote in message
news:21736bdb-302d-44b9-bd88-02ce898deeef@s8g2000prg.googlegroups.com...
> How to show a ABOUT Form????????
>
> Hello Everyone:
> I use C# want to Create a Project. In my project. there are two
> forms. One is main form, and another is a about form. In the about
> form there are some information about my project. such as author's
> information, product support and so on.
> Now, I add a button in the main form, I want that if the user click
> the button. It will show the about form . In button's event . the code
> like this:
> {
> about.show();
> }
> but it doesn't work, if in Delphi. It will be work.
> After that, I search the msdn. I know that there is a method called
> AddOwnedForm(); so I coded the code like below:
> {
> Form cs =new Form();
> this.AddOwnedForm (cs);
> cs.Show();
> }
> This can show a new Form , but it is not the about form....
> What I should do? I'm very sorry for my English , I 'm from China.


Re: How to show a ABOUT Form???????? by Peter

Peter
Mon Mar 17 12:20:08 CDT 2008

On Mon, 17 Mar 2008 08:23:28 -0700, Jeff Hopper =

<jeff@hopperconsulting.net_no-spam-plz> wrote:

> You should just be able to do this in the main form's button click eve=
nt =

> handler:
>
> private void buttonAbout_Click(object sender, EventArgs e)
> {
> new about().ShowDialog();
> }

Close. Except that this code fails to dispose the dialog when you're =

done. Forms that are shown modally are not disposed automatically when =
=

you close them, so your own code must do it explicitly.

So better would be:

using (Form about =3D new about())
{
about.ShowDialog();
}

Pete

Re: How to show a ABOUT Form???????? by Jeff

Jeff
Mon Mar 17 14:14:03 CDT 2008

Very good point, Pete!

Jeff

"Peter Duniho" <NpOeStPeAdM@nnowslpianmk.com> wrote in message
news:op.t757ru1i8jd0ej@petes-computer.local...
On Mon, 17 Mar 2008 08:23:28 -0700, Jeff Hopper
<jeff@hopperconsulting.net_no-spam-plz> wrote:

> You should just be able to do this in the main form's button click event
> handler:
>
> private void buttonAbout_Click(object sender, EventArgs e)
> {
> new about().ShowDialog();
> }

Close. Except that this code fails to dispose the dialog when you're
done. Forms that are shown modally are not disposed automatically when
you close them, so your own code must do it explicitly.

So better would be:

using (Form about = new about())
{
about.ShowDialog();
}

Pete