I'de like to ask users if they are able to save their work before they
close using the normal "Save? Yes, No, Cancel" type of message box.
I've got this so far:
private void Form1_Closing(object sender,
System.ComponentModel.CancelEventArgs e)
{
if(unSaved)
{
DialogResult result = MessageBox.Show("Do you want to save
the changes you made to" +
Path.GetFileName(currentFilePath) + "?", "Save
Changes?", MessageBoxButtons.YesNoCancel,
MessageBoxIcon.Exclamation);
if(result==DialogResult.Yes)
saveFile(currentFilePath);
if(result==DialogResult.Cancel)
{
}
if(result==DialogResult.No)
{
}
}
}
}
What can I put in the result==DialogResult.Cancel if statement to
cancel the closing process?
Also, I'de like to have a textbox that wordraps a single line of text
so it can be short in width but a bit longer in height and still be
able to show a large string because of wordwrap. I would basically
like to have a multiline textbox with wordwrap on without allowing
users to insert new lines in the text box. Too bad wordwrap does not
work when multiline is false.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com