Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Tagged as

TIP: Handling WPF DialogResult with simplicity

, 18 Jun 2010
Rate this:
Please Sign up or sign in to vote.
Or even...if (frm.ShowDialog() == true){ // do something here}
Or even...
 
if (frm.ShowDialog() == true)
{
  // do something here
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Andrew Rissing
Software Developer (Senior)
United States United States
Since I've begun my profession as a software developer, I've learned one important fact - change is inevitable. Requirements change, code changes, and life changes.
 
So..If you're not moving forward, you're moving backwards.

Comments and Discussions

 
GeneralIndeed you don't have to declare a variable to evaluate the ... PinmemberJaime Olivares5-Sep-10 22:16 
GeneralWhy not "if (frm.ShowDialog())"? PinmemberSimon Dufour19-Aug-10 3:22 
GeneralYeah, I'm not a big fan of "if (a == true)", but at least it... PinmemberAndrew Rissing29-Jun-10 3:38 
GeneralYeah, that would be equivalent to Equals(true), although it ... PinmemberJaime Olivares28-Jun-10 20:42 
Yeah, that would be equivalent to Equals(true), although it looks unnecessary like this typical case:
 
bool a = true;
if (a == true) { etc.... } // it would be enough: if (a)
 
But in this case IT IS necessary in order to avoid a compile-time error.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140826.1 | Last Updated 18 Jun 2010
Article Copyright 2010 by Andrew Rissing
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid