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

C#

 
QuestionDeleting rows in streams Pin
NaNg152419-Jun-06 9:28
NaNg152419-Jun-06 9:28 
AnswerRe: Deleting rows in streams Pin
Ed.Poore9-Jun-06 10:07
Ed.Poore9-Jun-06 10:07 
GeneralRe: Deleting rows in streams Pin
NaNg152419-Jun-06 10:26
NaNg152419-Jun-06 10:26 
GeneralRe: Deleting rows in streams Pin
Ed.Poore9-Jun-06 12:50
Ed.Poore9-Jun-06 12:50 
QuestionComboBox binding problem . Pin
microuser_20009-Jun-06 8:37
microuser_20009-Jun-06 8:37 
AnswerRe: ComboBox binding problem . Pin
Paul Brower9-Jun-06 9:12
Paul Brower9-Jun-06 9:12 
QuestionVisual C# and goto startup form Pin
Saamir9-Jun-06 7:47
Saamir9-Jun-06 7:47 
AnswerRe: Visual C# and goto startup form Pin
Alexander Wiseman9-Jun-06 7:58
Alexander Wiseman9-Jun-06 7:58 
Hi sasa,

You could work it this way:

1) In your CheckFile function and inside the if clause, return a value from the function which is meaningful to your cmdAdd_Click function, such as -1. Then in your cmdAdd_Click function, simply use the return keyword if CheckFile returns that value (in this case -1). It would look like this:
public int CheckFile()
{
...
     if(!cmdNew.Exists) // this is the same as cmdNew.Exists == false
     {
          ...
          if(Result == DialogResult.Yes)
               return -1;
     }
...
return 1; //or some other value which is not -1
}

private void cmdAdd_Click(object sender, System.EventArgs e)
{
     if(CheckFile() == -1)
          return;

     // The code below here should not get executed if CheckFile returned -1:
     AddDc frmAddDC = new AddDC();
     ...
}
Hope that helps!

Sincerely,
Alexander Wiseman
GeneralRe: Visual C# and goto startup form Pin
Saamir10-Jun-06 4:49
Saamir10-Jun-06 4:49 
QuestionC# designer Pin
Brandon Frye9-Jun-06 7:08
Brandon Frye9-Jun-06 7:08 
AnswerRe: C# designer Pin
LongRange.Shooter9-Jun-06 7:22
LongRange.Shooter9-Jun-06 7:22 
GeneralRe: C# designer Pin
Brandon Frye9-Jun-06 7:38
Brandon Frye9-Jun-06 7:38 
QuestionRegistry Scanner c# Pin
j1mb0jay9-Jun-06 5:45
j1mb0jay9-Jun-06 5:45 
AnswerRe: Registry Scanner c# [modified] Pin
LongRange.Shooter9-Jun-06 6:44
LongRange.Shooter9-Jun-06 6:44 
GeneralRe: Registry Scanner c# [modified] Pin
j1mb0jay9-Jun-06 6:50
j1mb0jay9-Jun-06 6:50 
GeneralRe: Registry Scanner c# [modified] Pin
LongRange.Shooter9-Jun-06 7:06
LongRange.Shooter9-Jun-06 7:06 
JokeRe: Registry Scanner c# Pin
BoneSoft9-Jun-06 11:04
BoneSoft9-Jun-06 11:04 
Questionchange form title (text) base on application Pin
donkaiser9-Jun-06 4:54
donkaiser9-Jun-06 4:54 
AnswerRe: change form title (text) base on application Pin
Stefan Troschuetz9-Jun-06 4:58
Stefan Troschuetz9-Jun-06 4:58 
AnswerRe: change form title (text) base on application Pin
Alexander Wiseman9-Jun-06 4:59
Alexander Wiseman9-Jun-06 4:59 
GeneralRe: change form title (text) base on application Pin
donkaiser9-Jun-06 5:20
donkaiser9-Jun-06 5:20 
QuestionDesign question Pin
Elina Blank9-Jun-06 4:52
sitebuilderElina Blank9-Jun-06 4:52 
AnswerRe: Design question Pin
LongRange.Shooter9-Jun-06 7:01
LongRange.Shooter9-Jun-06 7:01 
AnswerRe: Design question Pin
nevezuxa9-Jun-06 8:09
nevezuxa9-Jun-06 8:09 
AnswerRe: Design question Pin
BoneSoft9-Jun-06 11:32
BoneSoft9-Jun-06 11:32 

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.