Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
QuestionInspired by "Should we really use struct or not?" question Pin
Łukasz Nowakowski23-Sep-10 4:19
Łukasz Nowakowski23-Sep-10 4:19 
AnswerRe: Inspired by "Should we really use struct or not?" question Pin
Pete O'Hanlon23-Sep-10 4:43
mvePete O'Hanlon23-Sep-10 4:43 
GeneralRe: Inspired by "Should we really use struct or not?" question Pin
Luc Pattyn23-Sep-10 5:55
sitebuilderLuc Pattyn23-Sep-10 5:55 
GeneralRe: Inspired by "Should we really use struct or not?" question Pin
AspDotNetDev23-Sep-10 10:18
protectorAspDotNetDev23-Sep-10 10:18 
GeneralRe: Inspired by "Should we really use struct or not?" question Pin
Luc Pattyn23-Sep-10 10:40
sitebuilderLuc Pattyn23-Sep-10 10:40 
AnswerRe: Inspired by "Should we really use struct or not?" question Pin
Kevin McFarlane24-Sep-10 4:30
Kevin McFarlane24-Sep-10 4:30 
QuestionErrorProvider logic to avoid DialogResult.OK button completion? Pin
Chesnokov Yuriy23-Sep-10 4:02
professionalChesnokov Yuriy23-Sep-10 4:02 
AnswerRe: ErrorProvider logic to avoid DialogResult.OK button completion? Pin
Michael Eber30-Sep-10 12:08
Michael Eber30-Sep-10 12:08 
Your question is a little confusing but I'll take a stab at your question.

You cannot use the basic MessageBox for what you want to do. You creat a form, design it as a dialog, and put your own code in the form to accomplish that.
Now if you are really sharp then you can do something like this:

Create the form and make the constructor require an IValidator class passed in the constructor. Add an OkayButton CancelButton and make the OkayButton disabled.
Define your interface for IValidator.
The Validator will implement it's own rules for what is valid and what is invalid.
As the data is entered into the form, the data is passed into the validator such that OkayButton.Enabled = Validator.IsValid( entryBox.Text );

As long as the data is valid (or once it is valid) the button will light up. As long as it is invalid it remains disabled.

By doing this, you have an extensible dialog box that can have an infinite number of validation rules without ever having to change a line of code in the control.
QuestionShould we really use struct or not? Pin
stephen.darling23-Sep-10 2:11
stephen.darling23-Sep-10 2:11 
AnswerRe: Should we really use struct or not? Pin
Luc Pattyn23-Sep-10 2:52
sitebuilderLuc Pattyn23-Sep-10 2:52 
AnswerRe: Should we really use struct or not? Pin
Ian Shlasko23-Sep-10 2:52
Ian Shlasko23-Sep-10 2:52 
GeneralRe: Should we really use struct or not? Pin
stephen.darling23-Sep-10 2:57
stephen.darling23-Sep-10 2:57 
Questionreportviewer in multi-tier winform environment Pin
redspiderke23-Sep-10 1:50
redspiderke23-Sep-10 1:50 
AnswerRe: reportviewer in multi-tier winform environment Pin
Vimalsoft(Pty) Ltd23-Sep-10 3:16
professionalVimalsoft(Pty) Ltd23-Sep-10 3:16 
QuestionHow to add items to dictionary as you create it? Pin
Chesnokov Yuriy22-Sep-10 21:57
professionalChesnokov Yuriy22-Sep-10 21:57 
AnswerRe: How to add items to dictionary as you create it? PinPopular
tolw22-Sep-10 22:01
tolw22-Sep-10 22:01 
GeneralRe: How to add items to dictionary as you create it? Pin
Chesnokov Yuriy22-Sep-10 22:16
professionalChesnokov Yuriy22-Sep-10 22:16 
Questionhow to connect MySql via network Pin
Erdinc2722-Sep-10 20:52
Erdinc2722-Sep-10 20:52 
AnswerRe: how to connect MySql via network Pin
Simon_Whale22-Sep-10 22:12
Simon_Whale22-Sep-10 22:12 
GeneralRe: how to connect MySql via network Pin
Erdinc2722-Sep-10 22:35
Erdinc2722-Sep-10 22:35 
GeneralRe: how to connect MySql via network Pin
Simon_Whale22-Sep-10 22:41
Simon_Whale22-Sep-10 22:41 
GeneralRe: how to connect MySql via network Pin
Erdinc2722-Sep-10 22:56
Erdinc2722-Sep-10 22:56 
AnswerRe: how to connect MySql via network Pin
Saksida Bojan23-Sep-10 0:45
Saksida Bojan23-Sep-10 0:45 
GeneralRe: how to connect MySql via network Pin
Erdinc2723-Sep-10 1:46
Erdinc2723-Sep-10 1:46 
QuestionIcon for dll assembly Pin
Chesnokov Yuriy22-Sep-10 19:13
professionalChesnokov Yuriy22-Sep-10 19:13 

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.