Click here to Skip to main content
15,908,907 members
Home / Discussions / C#
   

C#

 
Questionhow to avoid a leave event after it is called Pin
eyalle18-Nov-09 19:30
eyalle18-Nov-09 19:30 
hello,
im looking for a solution with a slight problem that im sure it is possible, but i cant find anything about it on the web.
In my code, im calling a leave event out of a control that check's if the control has made any changes (txtBox, combo Box...) raising a question telling the user that changes weren't saved.
if the user click's on Cancel button, i want him to stay in the control and not actually leave like he initially did.
How can i do it ?
Thanks

private void TabControlChars_Leave(object sender, EventArgs e)
        {
            DataTable charChanges = null;

            if (charsTypeDT != null)
            {
                charChanges = charsTypeDT.GetChanges();
            }
            else if (charsDT != null)
            {
                charChanges = charsDT.GetChanges();
            }

            if (charChanges != null)
            {
                DialogResult result;
                result = MessageBox.Show("Changes were made without saving !!\n"
                               + "All Changes will be lost ...", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                if (result == DialogResult.Cancel)
                {
                    ???
                }
            }
        }

AnswerRe: how to avoid a leave event after it is called Pin
dan!sh 18-Nov-09 19:48
professional dan!sh 18-Nov-09 19:48 
AnswerRe: how to avoid a leave event after it is called Pin
Shameel18-Nov-09 21:29
professionalShameel18-Nov-09 21:29 
GeneralRe: how to avoid a leave event after it is called Pin
eyalle18-Nov-09 21:32
eyalle18-Nov-09 21:32 
GeneralRe: how to avoid a leave event after it is called Pin
Shameel18-Nov-09 22:51
professionalShameel18-Nov-09 22:51 
Questiongrid to database Pin
Member 59031018-Nov-09 19:20
Member 59031018-Nov-09 19:20 
AnswerRe: grid to database Pin
Abhijit Jana18-Nov-09 19:27
professionalAbhijit Jana18-Nov-09 19:27 
GeneralRe: grid to database Pin
Member 59031018-Nov-09 19:33
Member 59031018-Nov-09 19:33 
AnswerRe: grid to database Pin
Amit Patel198518-Nov-09 20:08
Amit Patel198518-Nov-09 20:08 
GeneralRe: grid to database Pin
Member 59031018-Nov-09 20:12
Member 59031018-Nov-09 20:12 
QuestionHow to add new line in cell gridview in desktop application Pin
Rajesh_K_Sharma18-Nov-09 19:05
Rajesh_K_Sharma18-Nov-09 19:05 
AnswerRe: How to add new line in cell gridview in desktop application Pin
Abhijit Jana18-Nov-09 19:25
professionalAbhijit Jana18-Nov-09 19:25 
QuestionReducing avi file size Pin
kjsl2k918-Nov-09 14:39
kjsl2k918-Nov-09 14:39 
AnswerRe: Reducing avi file size Pin
Eduard Keilholz18-Nov-09 22:06
Eduard Keilholz18-Nov-09 22:06 
GeneralRe: Reducing avi file size Pin
kjsl2k919-Nov-09 0:37
kjsl2k919-Nov-09 0:37 
QuestionAny Software tool available for generating UML ACTIVITY DIAGRAM from C# Code ? Pin
Nadia Monalisa18-Nov-09 14:07
Nadia Monalisa18-Nov-09 14:07 
AnswerRe: Any Software tool available for generating UML ACTIVITY DIAGRAM from C# Code ? Pin
Abhijit Jana18-Nov-09 16:36
professionalAbhijit Jana18-Nov-09 16:36 
AnswerRe: Any Software tool available for generating UML ACTIVITY DIAGRAM from C# Code ? Pin
RC nathan19-Nov-09 20:53
RC nathan19-Nov-09 20:53 
Questionasynchronous write file problem Pin
hande5418-Nov-09 11:45
hande5418-Nov-09 11:45 
AnswerRe: asynchronous write file problem Pin
Bassam Saoud18-Nov-09 12:30
Bassam Saoud18-Nov-09 12:30 
AnswerRe: asynchronous write file problem Pin
Dave Kreskowiak18-Nov-09 17:27
mveDave Kreskowiak18-Nov-09 17:27 
GeneralRe: asynchronous write file problem Pin
hande5419-Nov-09 6:38
hande5419-Nov-09 6:38 
QuestionHide Black Console Window later in program Pin
LimitedAtonement18-Nov-09 7:33
LimitedAtonement18-Nov-09 7:33 
AnswerRe: Hide Black Console Window later in program Pin
The Man from U.N.C.L.E.18-Nov-09 7:57
The Man from U.N.C.L.E.18-Nov-09 7:57 
GeneralRe: Hide Black Console Window later in program Pin
PIEBALDconsult18-Nov-09 9:23
mvePIEBALDconsult18-Nov-09 9:23 

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.