473,395 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Rookie Form Question

I have a csharp form1.cs created with VS. I have added a menu bar
with one option called help. I then created another form in VS called
help.cs. How can I launch the help form from the main form called
form1.

Seems simple.

private void menuItem5_Click(object sender, System.EventArgs e)
{
// Menuitem5_Click is the help menu item user sees
// Call help.cs
help.Gives me a bunch of methods like ActiveForm etc
}

Any suggestions. Basically I want to design a "help" form in VS and
then call it from my main form.

Thanks,

Dave
Nov 16 '05 #1
4 1428
Hello, Dave!
(new help()).Show();
or
help h=new help();
h.Show();

Second way allows you to do something
with the form before showing it.

You wrote on 5 Nov 2004 21:19:03 -0800:

DG> Seems simple.

DG> private void menuItem5_Click(object sender, System.EventArgs e)
DG> {
DG> // Menuitem5_Click is the help menu item user sees
DG> // Call help.cs
DG> help.Gives me a bunch of methods like ActiveForm etc
DG> }

DG> Any suggestions. Basically I want to design a "help" form in VS and
DG> then call it from my main form.

DG> Thanks,
With best regards, Nurchi BECHED.
Nov 16 '05 #2
HelpForm hf = new HelpForm();
hf.Show(); // or hf.ShowDialog() to show it in modal form

"Dave Guenthner" <da***@guenthners.com> wrote in message
news:ca*************************@posting.google.co m...
I have a csharp form1.cs created with VS. I have added a menu bar
with one option called help. I then created another form in VS called
help.cs. How can I launch the help form from the main form called
form1.

Seems simple.

private void menuItem5_Click(object sender, System.EventArgs e)
{
// Menuitem5_Click is the help menu item user sees
// Call help.cs
help.Gives me a bunch of methods like ActiveForm etc
}

Any suggestions. Basically I want to design a "help" form in VS and
then call it from my main form.

Thanks,

Dave
Nov 16 '05 #3
Thanks Guys! That allowed me to do exactly what I wanted. Create /
Design a form with VS and call it from main form.

Dave
"Shiva" <sh******@online.excite.com> wrote in message news:<#$**************@TK2MSFTNGP15.phx.gbl>...
HelpForm hf = new HelpForm();
hf.Show(); // or hf.ShowDialog() to show it in modal form

"Dave Guenthner" <da***@guenthners.com> wrote in message
news:ca*************************@posting.google.co m...
I have a csharp form1.cs created with VS. I have added a menu bar
with one option called help. I then created another form in VS called
help.cs. How can I launch the help form from the main form called
form1.

Seems simple.

private void menuItem5_Click(object sender, System.EventArgs e)
{
// Menuitem5_Click is the help menu item user sees
// Call help.cs
help.Gives me a bunch of methods like ActiveForm etc
}

Any suggestions. Basically I want to design a "help" form in VS and
then call it from my main form.

Thanks,

Dave

Nov 16 '05 #4
Dave, if you take shivas suggestion to show the form as a dialog, it is good
practice to handle the dialogresult of the form (if applicable)....it is
something that gets overlooked a lot in the early days of Win Form
programming.

// Display the form as a modal dialog box.
form1.ShowDialog();

// Determine if the OK button was clicked on the dialog box.
if (form1.DialogResult == DialogResult.OK)
{
// Display a message box indicating that the OK button was clicked.
MessageBox.Show("The OK button on the form was clicked.");
// Optional: Call the Dispose method when you are finished with the
dialog box.
form1.Dispose();
}
else
{
// Display a message box indicating that the Cancel button was
clicked.
MessageBox.Show("The Cancel button on the form was clicked.");
// Optional: Call the Dispose method when you are finished with the
dialog box.
form1.Dispose();
}

"Shiva" <sh******@online.excite.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
HelpForm hf = new HelpForm();
hf.Show(); // or hf.ShowDialog() to show it in modal form

"Dave Guenthner" <da***@guenthners.com> wrote in message
news:ca*************************@posting.google.co m...
I have a csharp form1.cs created with VS. I have added a menu bar
with one option called help. I then created another form in VS called
help.cs. How can I launch the help form from the main form called
form1.

Seems simple.

private void menuItem5_Click(object sender, System.EventArgs e)
{
// Menuitem5_Click is the help menu item user sees
// Call help.cs
help.Gives me a bunch of methods like ActiveForm etc
}

Any suggestions. Basically I want to design a "help" form in VS and
then call it from my main form.

Thanks,

Dave

Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mimi | last post by:
Hi there, I have a text file that contains teacher timetable information. I'd like to open the text file, wait for input in a text box on the form (a teacher name), then have that teacher's...
8
by: Tom | last post by:
Please help. I need a quick little scrpit to place on a web page that will count how many days have passed since January 1, 1970. I have ZERO experience writing ANY scripts. Anyone have any...
4
by: Derrick | last post by:
I want to create a form with a few text boxes, labels, etc, and then use that form on a tab control, and re-use it as a stand alone dialog, can you drop forms onto forms and into dialogs like you...
0
by: EZboy | last post by:
Rookie question ..... can anybody please send me a sample code that illustrates : how to display an mpg video clip on a new window that is being opened from within an application ? Many Thanks,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.