Newbie!! Needs help though!

  • Thread starter Thread starter Zack Whittaker \(R2 Mentor\)
  • Start date Start date
Z

Zack Whittaker \(R2 Mentor\)

Hey,

I'm very new to all this C# stuff and I think I might need a little bit of help! I've got
Microsoft Visual C# 2005 Express Edition Beta2 running, and I'm making at the moment a
simple application which has a menu bar of "About" and "Help" and that's it, but with a
web browser window for the rest of it, which displays my website. However, I've got the
web browser bit working fine and within my application I can see my website (hurrah!).

However, I can't seem to work out how to get my menu bar to work. There's only two menu's,
About (which has Application, Company, a seperator then Exit) and then Help (which has
Contents and Contact) on it... but how do I make a popup box appear when I click on one,
and then edit that? If I can get say, About > Application to make a popup, then I can
display information about the application itself.

Any ideas? :o)


--
Zack Whittaker
Microsoft Beta (Windows Server R2 Beta Mentor)
» ZackNET Enterprises: www.zacknet.cjb.net
» MSBlog on ResDev: http://msblog.resdev.net
» This mailing is provided "as is" with no warranties, and confers no
rights. All opinions expressed are those of myself unless stated so, and not
of my employer, best friend, mother or cat. Let's be clear on that one!
 
Hi Zack,
add your menu strip to your app then all you have to do is double click on
each menu item in designer mode and an event handler will be automatically
added to the code which will be called each time you click on the menu item
at runtime.

Hope that helps
Mark R Dawson
http://www.markdawson.org
 
Zack Whittaker (R2 Mentor) said:
If I can get say, About > Application to make a popup, then I can display
information about the application itself.

Add a new form to your project (right-click in solution explorer -> new ->
form) and give it a name (eg. frmAbout). Open your menu and double-click on
the Application option, which should add an event handler. Add some code
like this:

frmAbout about = new frmAbout(); // This creates a new instance of your
dialog
about.ShowDialog(); // This shows it to the user and blocks until they close
it

That's it. You can replace ShowDialog with just Show if you'd like the user
to be able to switch back to your application without closing the dialog
(modal vs non-modal).

HTH
 
Woohoo! Thanks Daniel, works a treat!! :oD

Just as a thought though (that message previously I've saved for future reference), but
how would I put a close button on that popup to close it?

Thanks,


--
Zack Whittaker
Microsoft Beta (Windows Server R2 Beta Mentor)
» ZackNET Enterprises: www.zacknet.cjb.net
» MSBlog on ResDev: http://msblog.resdev.net
» This mailing is provided "as is" with no warranties, and confers no
rights. All opinions expressed are those of myself unless stated so, and not
of my employer, best friend, mother or cat. Let's be clear on that one!
 
Its OK, just done the close button LOL.


--
Zack Whittaker
Microsoft Beta (Windows Server R2 Beta Mentor)
» ZackNET Enterprises: www.zacknet.cjb.net
» MSBlog on ResDev: http://msblog.resdev.net
» This mailing is provided "as is" with no warranties, and confers no
rights. All opinions expressed are those of myself unless stated so, and not
of my employer, best friend, mother or cat. Let's be clear on that one!
 
Back
Top