Click here to Skip to main content
15,919,613 members
Home / Discussions / C#
   

C#

 
GeneralRe: Using Excel.WorksheetFunction in C# Pin
sreejith ss nair20-Sep-04 1:08
sreejith ss nair20-Sep-04 1:08 
GeneralRe: Using Excel.WorksheetFunction in C# Pin
itstime9820-Sep-04 1:39
itstime9820-Sep-04 1:39 
GeneralRe: Using Excel.WorksheetFunction in C# Pin
itstime9820-Sep-04 1:50
itstime9820-Sep-04 1:50 
GeneralRe: Using Excel.WorksheetFunction in C# Pin
ODS21-Sep-04 1:29
ODS21-Sep-04 1:29 
GeneralRe: Using Excel.WorksheetFunction in C# Pin
itstime9821-Sep-04 18:46
itstime9821-Sep-04 18:46 
GeneralForm.Close() Pin
exhaulted20-Sep-04 0:43
exhaulted20-Sep-04 0:43 
GeneralRe: Form.Close() Pin
sreejith ss nair20-Sep-04 0:58
sreejith ss nair20-Sep-04 0:58 
GeneralRe: Form.Close() Pin
exhaulted20-Sep-04 1:32
exhaulted20-Sep-04 1:32 
OK, Lets try to make things a little clearer.
I can already check for the password using the Form.Closing event.
<br />
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)<br />
{<br />
	//Write the details<br />
	SaveSchedules();<br />
<br />
	//Check for the password<br />
	if (!(CheckPassword()))<br />
            e.Cancel = true;<br />
	else<br />
	//Hide the notify icon<br />
	    notifyIcon.Visible = false;<br />
}


CheckPassword() returns a bool depending on the password entered.
The above bit is the easy part, what i need to do is to know wether
the user is closing the aplication by clicking on the cross on the form
or the system is closing the application because the user has tried to log
off / shut down the PC.

Kev
P.S. How do you get the Yellow background behind code samples??
Generalmainly p.s. Pin
yoaz20-Sep-04 2:01
yoaz20-Sep-04 2:01 
GeneralRe: mainly p.s. Pin
exhaulted20-Sep-04 3:09
exhaulted20-Sep-04 3:09 
GeneralRe: mainly p.s. Pin
Charlie Williams20-Sep-04 5:00
Charlie Williams20-Sep-04 5:00 
GeneralRe: mainly p.s. Pin
exhaulted20-Sep-04 5:17
exhaulted20-Sep-04 5:17 
GeneralRe: Form.Close() Pin
Salil Khedkar20-Sep-04 2:10
Salil Khedkar20-Sep-04 2:10 
GeneralRe: Form.Close() Pin
exhaulted20-Sep-04 3:15
exhaulted20-Sep-04 3:15 
GeneralRe: Form.Close() Pin
Heath Stewart20-Sep-04 6:55
protectorHeath Stewart20-Sep-04 6:55 
GeneralRe: Form.Close() Pin
exhaulted20-Sep-04 22:22
exhaulted20-Sep-04 22:22 
GeneralRe: Form.Close() Pin
Salil Khedkar20-Sep-04 23:30
Salil Khedkar20-Sep-04 23:30 
GeneralRe: Form.Close() Pin
exhaulted21-Sep-04 4:11
exhaulted21-Sep-04 4:11 
GeneralRe: Form.Close() Pin
Heath Stewart21-Sep-04 5:28
protectorHeath Stewart21-Sep-04 5:28 
GeneralRe: Form.Close() Pin
exhaulted21-Sep-04 6:23
exhaulted21-Sep-04 6:23 
GeneralRe: Form.Close() Pin
Heath Stewart21-Sep-04 6:37
protectorHeath Stewart21-Sep-04 6:37 
GeneralRe: Form.Close() Pin
exhaulted21-Sep-04 22:44
exhaulted21-Sep-04 22:44 
GeneralRe: Form.Close() Pin
Heath Stewart22-Sep-04 6:57
protectorHeath Stewart22-Sep-04 6:57 
GeneralRe: Form.Close() Pin
yoaz20-Sep-04 2:56
yoaz20-Sep-04 2:56 
GeneralRe: Form.Close() Pin
exhaulted20-Sep-04 3:10
exhaulted20-Sep-04 3:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.