PC Review


Reply
Thread Tools Rate Thread

Code for Menu File Exit

 
 
Chris
Guest
Posts: n/a
 
      10th Jan 2005
Hi,

A simple question ..

In the design mode I added the standard File Menu, so, New,
Open, Save etc. to my Window Form application.

On File Exit, I added code like:
private void FileExit_clicked(object sender, EventArgs e)
{
this.Close();
}

but nothing happened.

The form does not disappear from the screen.

Seems to be something wrong ??

Thx,
Chris



 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      10th Jan 2005
Chris,

What is "this" pointing to? If it is the form, then it *should* close,
and all the child windows as well.

Have you also tried the static Exit method on the Application class in
the System.Windows.Forms namespace?

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"Chris" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> A simple question ..
>
> In the design mode I added the standard File Menu, so, New,
> Open, Save etc. to my Window Form application.
>
> On File Exit, I added code like:
> private void FileExit_clicked(object sender, EventArgs e)
> {
> this.Close();
> }
>
> but nothing happened.
>
> The form does not disappear from the screen.
>
> Seems to be something wrong ??
>
> Thx,
> Chris
>
>
>



 
Reply With Quote
 
Chris
Guest
Posts: n/a
 
      11th Jan 2005
It seems my function *FileExit_clicked* is not called at
all, if I click File|Exit..

Do I have to change something in the properties. Now I see
name like *menuitem6* etc. Is that OK ?

I never worked with menus before ..



"Nicholas Paldino [.NET/C# MVP]"
<(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Chris,
>
> What is "this" pointing to? If it is the form, then

it *should* close,
> and all the child windows as well.
>
> Have you also tried the static Exit method on the

Application class in
> the System.Windows.Forms namespace?
>
> Hope this helps.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - (E-Mail Removed)
>
> "Chris" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi,
> >
> > A simple question ..
> >
> > In the design mode I added the standard File Menu, so,

New,
> > Open, Save etc. to my Window Form application.
> >
> > On File Exit, I added code like:
> > private void FileExit_clicked(object sender,

EventArgs e)
> > {
> > this.Close();
> > }
> >
> > but nothing happened.
> >
> > The form does not disappear from the screen.
> >
> > Seems to be something wrong ??
> >
> > Thx,
> > Chris
> >
> >
> >

>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
scheduled tasks last result 0x9 0x3 exit code 3 exit code 9 John Windows XP General 4 5th Mar 2008 08:02 PM
What is the diffrences between close & exit option of file menu RG Microsoft Word Document Management 1 22nd Dec 2007 03:24 AM
RE: custom menu disappears when I File, Exit, Cancel =?Utf-8?B?U21hbGx3ZWVk?= Microsoft Excel Programming 0 14th Nov 2007 03:42 PM
Can only exit the program from the file menu =?Utf-8?B?Q2h1Y2sgQm93c2Vy?= Microsoft Excel Misc 1 11th Apr 2006 03:08 PM
VB code exit error when run via scheduler giving exit code of (c000008f). connoisseur.infotech@gmail.com Microsoft VB .NET 1 4th Aug 2005 02:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:14 AM.