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.
Paul E Collins - 17 Mar 2008 14:35 GMT
> How to show a ABOUT Form????????
MyAboutForm f = new MyAboutForm();
f.ShowDialog(this);
Eq.
Peter Duniho - 17 Mar 2008 18:38 GMT
>> How to show a ABOUT Form????????
>
> MyAboutForm f = new MyAboutForm();
> f.ShowDialog(this);
Hmph. Not only did the OP multi-post (in m.p.dotnet.framework at
least...I wonder how many other newsgroups he hit), but the reply in that
other newsgroup had the same error the above reply has. No dispose!
To the OP, please see my reply in m.p.dotnet.framework for an explanation
as to the correct way to do this. And please don't multi-post again. If
you must post the same question to more than one newsgroup, learn how to
cross-post correctly.
Pete
Paul E Collins - 17 Mar 2008 22:43 GMT
> the reply in that other newsgroup had the same error the above reply
> has. No dispose!
Oops, yes. I was trying to keep it simple, I suppose, but without
Dispose it's incomplete.
Eq.
Mythran - 17 Mar 2008 21:19 GMT
>> How to show a ABOUT Form????????
>
> MyAboutForm f = new MyAboutForm();
> f.ShowDialog(this);
>
> Eq.
- or -
using (MyAboutForm f = new MyAboutForm()) {
f.ShowDialog(this);
}
To release any unmanaged resources created/maintained by the form's code.
HTH,
Mythran