What function is called in response to a click on "Close" on system menu (the
"X" in the top right side of window)? 6 1557
The following events will be called,
Deactivate
Closing
Closed
private void Form1_Closed(object sender, System.EventArgs e)
{
}
private void Form1_Closing(object sender,
System.ComponentModel.CancelEventArgs e)
{
}
private void Form1_Deactivate(object sender, System.EventArgs e)
{
}
--
Regards,
Amal [MCP, MCS] http://geocities.com/techsharing
"Scotty" wrote: What function is called in response to a click on "Close" on system menu (the "X" in the top right side of window)?
I tried this but the events weren't call. If I click on the Close nothing
happens. What am I doing wrong?
// private void Form1_Closed(object sender, System.EventArgs e)
// private void Form1_Closing(object sender,
System.ComponentModel.CancelEventArgs e)
private void Form1_Deactivate(object sender, System.EventArgs e)
{
DialogResult result;
if (chng == true)
{
result = MessageBox.Show("Do you want to save your file?",
"Save?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation);
if (result == DialogResult.Cancel)
return;
if (result == DialogResult.Yes)
{
if (Filename == null)
{
saveAsToolStripMenuItem_Click(sender, e);
}
if (Filename != null)
{
Cover(); // get text into richTextBox7
using (StreamWriter sr = new StreamWriter(Filename))
{
sr.Write(richTextBox7.Text);
}
}
}
}
}
"Amalorpavanathan Yagulasamy(AMAL)MCP,MCS" wrote: The following events will be called, Deactivate Closing Closed
private void Form1_Closed(object sender, System.EventArgs e) { }
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e) { }
private void Form1_Deactivate(object sender, System.EventArgs e) { }
-- Regards, Amal [MCP, MCS] http://geocities.com/techsharing
"Scotty" wrote:
What function is called in response to a click on "Close" on system menu (the "X" in the top right side of window)?
Check to see if the events were actually wired to the functions.
--
Jonathan Allen
"Scotty" <Sc**********************@sil.org> wrote in message
news:BD**********************************@microsof t.com... I tried this but the events weren't call. If I click on the Close nothing happens. What am I doing wrong?
// private void Form1_Closed(object sender, System.EventArgs e) // private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e) private void Form1_Deactivate(object sender, System.EventArgs e) { DialogResult result; if (chng == true) { result = MessageBox.Show("Do you want to save your file?", "Save?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation); if (result == DialogResult.Cancel) return; if (result == DialogResult.Yes) { if (Filename == null) { saveAsToolStripMenuItem_Click(sender, e); } if (Filename != null) { Cover(); // get text into richTextBox7 using (StreamWriter sr = new StreamWriter(Filename)) { sr.Write(richTextBox7.Text); } } } } }
"Amalorpavanathan Yagulasamy(AMAL)MCP,MCS" wrote:
The following events will be called, Deactivate Closing Closed
private void Form1_Closed(object sender, System.EventArgs e) { }
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e) { }
private void Form1_Deactivate(object sender, System.EventArgs e) { }
-- Regards, Amal [MCP, MCS] http://geocities.com/techsharing
"Scotty" wrote:
> What function is called in response to a click on "Close" on system > menu (the > "X" in the top right side of window)?
How do I do that? (Newbie question)
"Jonathan Allen" wrote: Check to see if the events were actually wired to the functions.
-- Jonathan Allen
"Scotty" <Sc**********************@sil.org> wrote in message news:BD**********************************@microsof t.com...I tried this but the events weren't call. If I click on the Close nothing happens. What am I doing wrong?
// private void Form1_Closed(object sender, System.EventArgs e) // private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e) private void Form1_Deactivate(object sender, System.EventArgs e) { DialogResult result; if (chng == true) { result = MessageBox.Show("Do you want to save your file?", "Save?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation); if (result == DialogResult.Cancel) return; if (result == DialogResult.Yes) { if (Filename == null) { saveAsToolStripMenuItem_Click(sender, e); } if (Filename != null) { Cover(); // get text into richTextBox7 using (StreamWriter sr = new StreamWriter(Filename)) { sr.Write(richTextBox7.Text); } } } } }
"Amalorpavanathan Yagulasamy(AMAL)MCP,MCS" wrote:
The following events will be called, Deactivate Closing Closed
private void Form1_Closed(object sender, System.EventArgs e) { }
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e) { }
private void Form1_Deactivate(object sender, System.EventArgs e) { }
-- Regards, Amal [MCP, MCS] http://geocities.com/techsharing
"Scotty" wrote:
> What function is called in response to a click on "Close" on system > menu (the > "X" in the top right side of window)?
Look for code like this for each event. It should be in the initialize
component method.
this.Deactivate += new System.EventHandler(this.Form1_Deactivate);
--
Jonathan Allen
"Scotty" <Sc**********************@sil.org> wrote in message
news:12**********************************@microsof t.com... How do I do that? (Newbie question)
"Jonathan Allen" wrote:
Check to see if the events were actually wired to the functions.
-- Jonathan Allen
"Scotty" <Sc**********************@sil.org> wrote in message news:BD**********************************@microsof t.com... >I tried this but the events weren't call. If I click on the Close >nothing > happens. What am I doing wrong? > > // private void Form1_Closed(object sender, System.EventArgs e) > // private void Form1_Closing(object sender, > System.ComponentModel.CancelEventArgs e) > private void Form1_Deactivate(object sender, System.EventArgs e) > { > DialogResult result; > if (chng == true) > { > result = MessageBox.Show("Do you want to save your > file?", > "Save?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation); > if (result == DialogResult.Cancel) > return; > if (result == DialogResult.Yes) > { > if (Filename == null) > { > saveAsToolStripMenuItem_Click(sender, e); > } > if (Filename != null) > { > Cover(); // get text into richTextBox7 > using (StreamWriter sr = new > StreamWriter(Filename)) > { > sr.Write(richTextBox7.Text); > } > } > } > } > } > >
Great! Thanks.
I try it with
"private void Form1_Closed(object sender, System.EventArgs e)"
and it worked!
Scott
"Jonathan Allen" wrote: Look for code like this for each event. It should be in the initialize component method.
this.Deactivate += new System.EventHandler(this.Form1_Deactivate);
-- Jonathan Allen "Scotty" <Sc**********************@sil.org> wrote in message news:12**********************************@microsof t.com... How do I do that? (Newbie question)
"Jonathan Allen" wrote:
Check to see if the events were actually wired to the functions.
-- Jonathan Allen
"Scotty" <Sc**********************@sil.org> wrote in message news:BD**********************************@microsof t.com... >I tried this but the events weren't call. If I click on the Close >nothing > happens. What am I doing wrong? > > // private void Form1_Closed(object sender, System.EventArgs e) > // private void Form1_Closing(object sender, > System.ComponentModel.CancelEventArgs e) > private void Form1_Deactivate(object sender, System.EventArgs e) > { > DialogResult result; > if (chng == true) > { > result = MessageBox.Show("Do you want to save your > file?", > "Save?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation); > if (result == DialogResult.Cancel) > return; > if (result == DialogResult.Yes) > { > if (Filename == null) > { > saveAsToolStripMenuItem_Click(sender, e); > } > if (Filename != null) > { > Cover(); // get text into richTextBox7 > using (StreamWriter sr = new > StreamWriter(Filename)) > { > sr.Write(richTextBox7.Text); > } > } > } > } > } > > This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Raymond H. |
last post by:
Hello,
I tried for a long time to find a means of preventing the menu of the
right button of the mouse to appear in Textbox but without success because I
always could found a way of making it...
|
by: jrlen balane |
last post by:
i am working on an MDIParentFrame and MDIChildFrame. Now, what i want
to do is make the ChildFrame not that easy to close by removing the
close button (the X on the right most corner of the window)...
|
by: Joseph Ellis |
last post by:
Hello all.
I have a family website that I have been maintaining for the past year
and a half or so. It includes a photo album that has grown quite
large. So far I've displayed the photo album...
|
by: Michael Kalina |
last post by:
Hi!
On my website http://michaelsremarks.com I use an elastic layout and I
would like the top left and top right corner to be "rounded".
Now I am facing two problems, which I could not solve...
|
by: Pmb |
last post by:
I've been working on creating a Complex class for my own learning purpose
(learn through doing etc.). I'm once again puzzled about something. I can't
figure out how to overload the assignment...
|
by: Alan Ho |
last post by:
Cheers~
|
by: meltedown |
last post by:
I run into this problem over and over and over again and its driving me
crazy.
This has a menu on the floated menu on the left.
The part to the left of that menu has a margin-left
It look...
|
by: Viken Karaguesian |
last post by:
Hello all,
On occasion I want to open hyperlinks (images, etc.) in a new window. In the
past, I've used target="_blank" to open the link in a new window. However,
using the "target" attribute...
|
by: Kelii |
last post by:
I've been beating my head against this problem for the last several
days, and I haven't found a decent solution yet. So I'm turning to the
group for some moral support or better yet some answers.
...
|
by: bogdan |
last post by:
Hi,
I have a div to provide a background image for a menu. I'd like to position
the menu on the right side but I can't seem to find a right way of doing it.
The only way the menu will move to...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
| |