I have a unique c# source file named source.cs
that i compile using CSharpCodeProvider from a builder to get an executable.
I would put an option on the builder whether to display the About form on application startup or not.
How can i create a form with title as About Us then add controls within (Labels, RichTextEdit etc..)
Something like
if (display_about_dialog) {
// code to display the form }
Any help would be highly appreciated
Try something like this:
using (Form form = new Form())
{
form.Text = "About Us";
// form.Controls.Add(...);
form.ShowDialog();
}
Here's the documentation page for the System.Windows.Forms.Form
class.
if you have a class MyForm : System.Windows.Forms.Form
(that you create using windows form builder)
You can do
MyForm form = new MyForm();
form.Show();
To launch an instance of MyForm.
Though if you want to create a simple confirmation or message dialog, check out the many uses of MessageBox
MessageBox.Show("text");
MessageBox.Show("text", "title", MessageBoxButtons.OKCancel);
Form aForm = new Form();
aForm.Text = @"About Us";
aForm.Controls.Add(new Label() {Text = "Version 5.0"});
aForm.ShowDialog(); // Or just use Show(); if you don't want it to be modal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With