Click here to Skip to main content
15,889,281 members
Home / Discussions / C#
   

C#

 
AnswerRe: Magnetic Card Reader Pin
led mike13-Nov-06 11:23
led mike13-Nov-06 11:23 
QuestionSystem.Data.OleDb & Microsoft Excel Pin
shopi3013-Nov-06 10:44
shopi3013-Nov-06 10:44 
QuestionGetting returns from a messagebox Pin
Blekk13-Nov-06 9:19
Blekk13-Nov-06 9:19 
AnswerRe: Getting returns from a messagebox Pin
Dan Neely13-Nov-06 9:24
Dan Neely13-Nov-06 9:24 
GeneralRe: Getting returns from a messagebox Pin
Blekk13-Nov-06 9:28
Blekk13-Nov-06 9:28 
GeneralRe: Getting returns from a messagebox Pin
Pradeep C13-Nov-06 10:08
Pradeep C13-Nov-06 10:08 
GeneralRe: Getting returns from a messagebox Pin
Blekk13-Nov-06 10:10
Blekk13-Nov-06 10:10 
GeneralRe: Getting returns from a messagebox Pin
Pradeep C13-Nov-06 10:22
Pradeep C13-Nov-06 10:22 
The way I think about it is like this:
We create normal classes (with constructor) because we might want to have multiple instances of that class at the same time. There is no need to create multiple instances of the MessageBox class because the only thing you use a MessageBox is to show it to the user and wait for a input. The MessageBox is a modal dialog and hence the application will have to sit and wait till user clicks a button. Once the user clicks the button the only information you will need is which button the user clicked (if there is more than one button). So the entire purpose for which MessageBox class exists is finished when we call the Show method and check its return value. Hence the natural way is to make it a static class so that its very easy for use (means write less code). User never needs to create an instance.

---
"Drawing on my superior command of language I said nothing."

GeneralRe: Getting returns from a messagebox Pin
User 665813-Nov-06 10:24
User 665813-Nov-06 10:24 
GeneralRe: Getting returns from a messagebox Pin
Blekk13-Nov-06 10:29
Blekk13-Nov-06 10:29 
GeneralRe: Getting returns from a messagebox Pin
John Arlen113-Nov-06 10:09
John Arlen113-Nov-06 10:09 
GeneralRe: Getting returns from a messagebox Pin
Judah Gabriel Himango13-Nov-06 10:09
sponsorJudah Gabriel Himango13-Nov-06 10:09 
GeneralRe: Getting returns from a messagebox Pin
shopi3013-Nov-06 10:12
shopi3013-Nov-06 10:12 
GeneralRe: Getting returns from a messagebox Pin
Blekk13-Nov-06 10:11
Blekk13-Nov-06 10:11 
AnswerRe: Getting returns from a messagebox Pin
Blekk13-Nov-06 10:23
Blekk13-Nov-06 10:23 
Questionhow can i Pin
Friend4u13-Nov-06 8:50
Friend4u13-Nov-06 8:50 
AnswerRe: how can i Pin
ednrgc13-Nov-06 8:59
ednrgc13-Nov-06 8:59 
AnswerRe: how can i Pin
shopi3013-Nov-06 10:35
shopi3013-Nov-06 10:35 
QuestionCustom Button Background Pin
GoldenFrog13-Nov-06 8:12
GoldenFrog13-Nov-06 8:12 
AnswerRe: Custom Button Background Pin
Pradeep C13-Nov-06 10:28
Pradeep C13-Nov-06 10:28 
GeneralRe: Custom Button Background Pin
GoldenFrog13-Nov-06 11:14
GoldenFrog13-Nov-06 11:14 
GeneralRe: Custom Button Background Pin
Anthony Mushrow13-Nov-06 12:44
professionalAnthony Mushrow13-Nov-06 12:44 
QuestionCan't save after importing Access file Pin
Bjorn240413-Nov-06 7:42
Bjorn240413-Nov-06 7:42 
AnswerRe: Can't save after importing Access file Pin
George L. Jackson13-Nov-06 8:33
George L. Jackson13-Nov-06 8:33 
QuestionEditing File Properties Pin
digital_loser13-Nov-06 6:22
digital_loser13-Nov-06 6:22 

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.