General C# question
-
What are some advantages of using Forms over MessageBoxes? And, is a return statement required in a method that returns the type void?
cmh623 wrote:
What are some advantages of using Forms over MessageBoxes?
Well, the obvious one is that you can design a form any way you like, a MessageBox is very limited.
cmh623 wrote:
And, is a return statement required in a method that returns the type void?
This is the sort of question where it would make sense to try it and so. The answer is no. You'd only use it to terminate execution based on a condition such as if (i <0) return;
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
cmh623 wrote:
What are some advantages of using Forms over MessageBoxes?
Well, the obvious one is that you can design a form any way you like, a MessageBox is very limited.
cmh623 wrote:
And, is a return statement required in a method that returns the type void?
This is the sort of question where it would make sense to try it and so. The answer is no. You'd only use it to terminate execution based on a condition such as if (i <0) return;
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
"Use the right tool for the right job." -- Scotty (among others) If you adopt the "Every method shall have one and only one
return
statement." ethic, as I have, then yes. (But the compiler makes the final decision.) ((Andyield
messes it up a bit.)) -
"Use the right tool for the right job." -- Scotty (among others) If you adopt the "Every method shall have one and only one
return
statement." ethic, as I have, then yes. (But the compiler makes the final decision.) ((Andyield
messes it up a bit.))PIEBALDconsult wrote:
ethic, as I have
So have I, and that may have colored my response, but all I meant was, you can use it in the middle, but if it's not used around a condition, then the middle will become the end, and using it at the end, is pointless. Yes, I didn't confuse things by mentioning 'yield' :0)
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
What are some advantages of using Forms over MessageBoxes? And, is a return statement required in a method that returns the type void?
cmh623 wrote:
some advantages of using Forms over MessageBoxes?
You have better flexibility and control. Customization is far better with forms than messageboxes.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon