close a window on btn clk [modified]
-
hi. i knw how to opn a window like my document on btn clk in c# but i dont knw how to close this window. if i use close() function thn it close the program. how can i clse the windo on btn clk?
modified on Tuesday, March 1, 2011 1:56 AM
this.Close
will close the current Form instance: If this is the main form that was opened when you application started, it will indeed close the application. For other forms it will just close them. If you need to alter this behaviour, you need to look in "program.cs" at the Main method: theApplication.Run();
line starts your form going, and waits until it closes. Be careful to provide some mechanism for closing your application or you will just annoy your users!Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
-
hi. i knw how to opn a window like my document on btn clk in c# but i dont knw how to close this window. if i use close() function thn it close the program. how can i clse the windo on btn clk?
modified on Tuesday, March 1, 2011 1:56 AM
Who have you annoyed? I don't know who down voted a reasonable question, but I have compensated.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
-
Who have you annoyed? I don't know who down voted a reasonable question, but I have compensated.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
It would be some loser who doesn't understand that not everyone in the world speaks English. Imagine the shock when they go OS and discover the world is full of foreigners. :wtf: [edit] I take back that comment. It was given a 1 because it was txt [edit]
"You get that on the big jobs."
-
Who have you annoyed? I don't know who down voted a reasonable question, but I have compensated.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
OriginalGriff wrote:
Who have you annoyed
Everyone who attempts to read the question. I realise english is unlikely to be the OPs first language but that is bloody difficult to read. A bit petty but you asked.
Never underestimate the power of human stupidity RAH
-
hi. i knw how to opn a window like my document on btn clk in c# but i dont knw how to close this window. if i use close() function thn it close the program. how can i clse the windo on btn clk?
modified on Tuesday, March 1, 2011 1:56 AM
-
OriginalGriff wrote:
Who have you annoyed
Everyone who attempts to read the question. I realise english is unlikely to be the OPs first language but that is bloody difficult to read. A bit petty but you asked.
Never underestimate the power of human stupidity RAH
:laugh: I know what you mean! Still not a reason for downvoting it though: ignore it instead, or post "wftru n abt?"
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together. Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
-
OriginalGriff wrote:
Who have you annoyed
Everyone who attempts to read the question. I realise english is unlikely to be the OPs first language but that is bloody difficult to read. A bit petty but you asked.
Never underestimate the power of human stupidity RAH
Mycroft Holmes wrote:
I realise english is unlikely to be the OPs first language but that is bloody difficult to read.
That's no reason to down vote them. I wonder how many English speakers here could formulate a clear question or answer in Arabic, Hindi, Greek or Russian for example.
I must get a clever new signature for 2011.
-
Mycroft Holmes wrote:
I realise english is unlikely to be the OPs first language but that is bloody difficult to read.
That's no reason to down vote them. I wonder how many English speakers here could formulate a clear question or answer in Arabic, Hindi, Greek or Russian for example.
I must get a clever new signature for 2011.
Richard MacCutchan wrote:
That's no reason to down vote them
Oh I agree with you there, as I said, very petty. I once had to communcate with some Japanese devs, bloody impossible, my multi lingual skills are non existent.
Never underestimate the power of human stupidity RAH
-
hi. i knw how to opn a window like my document on btn clk in c# but i dont knw how to close this window. if i use close() function thn it close the program. how can i clse the windo on btn clk?
modified on Tuesday, March 1, 2011 1:56 AM
aeman wrote:
window like my document on btn clk in c# but i dont klnw how to close this window.
If by this you mean open another program from c# like word the close it
Process []pArry = Process.GetProcesses();
foreach(Process p in pArry)
{
string s = p.ProcessName;
s = s.ToLower();
if (s.CompareTo("winword") ==0)
{
p.Kill();
}
}Above code will close word application.
-
hi. i knw how to opn a window like my document on btn clk in c# but i dont knw how to close this window. if i use close() function thn it close the program. how can i clse the windo on btn clk?
modified on Tuesday, March 1, 2011 1:56 AM
-
aeman wrote:
window like my document on btn clk in c# but i dont klnw how to close this window.
If by this you mean open another program from c# like word the close it
Process []pArry = Process.GetProcesses();
foreach(Process p in pArry)
{
string s = p.ProcessName;
s = s.ToLower();
if (s.CompareTo("winword") ==0)
{
p.Kill();
}
}Above code will close word application.