Click here to Skip to main content
15,914,250 members
Home / Discussions / C#
   

C#

 
GeneralRe: Mdichild form goes behind panel Pin
Abhinav S18-Feb-10 8:47
Abhinav S18-Feb-10 8:47 
GeneralRe: Mdichild form goes behind panel Pin
ronakT19-Feb-10 5:19
ronakT19-Feb-10 5:19 
GeneralRe: Mdichild form goes behind panel Pin
EliottA18-Feb-10 9:05
EliottA18-Feb-10 9:05 
GeneralRe: Mdichild form goes behind panel Pin
ronakT19-Feb-10 5:21
ronakT19-Feb-10 5:21 
QuestionValidation on Data Object in Code, not XAML? Pin
MattFunke18-Feb-10 4:25
MattFunke18-Feb-10 4:25 
AnswerRe: Validation on Data Object in Code, not XAML? Pin
OriginalGriff18-Feb-10 4:47
mveOriginalGriff18-Feb-10 4:47 
GeneralRe: Validation on Data Object in Code, not XAML? Pin
MattFunke18-Feb-10 4:50
MattFunke18-Feb-10 4:50 
AnswerRe: Validation on Data Object in Code, not XAML? Pin
Ennis Ray Lynch, Jr.18-Feb-10 5:42
Ennis Ray Lynch, Jr.18-Feb-10 5:42 
Did you really get this code from book? I really need to write a book.

BTW, you are binding to the Text property of the TextField. In code and not automagic binding, what kind of happens is this:

public class TextBox{
    public string this[string fieldName]{
        get;
        set;
    }

}
TextBox foo = new TextBox();
foo.Text = "Some Value";


So the Text Property is getting fired. Your codes seems to be:
public class TextBox{
    public string Text{
        get{...}
        set{...}
    }

}
TextBox foo = new TextBox();
foo["test"] = "test";


What I think the Author meant was, register the Notify Property event changed from the parent Text Box then call your validate method which should be a method and not an indexor like:

public class TextBox : System.Windows.Forms.TextBox {
    protected override void OnTextChanged(EventArgs e) {
        base.OnTextChanged(e);
	Validate();
    }
    public void Validate() {
        //crappy code to throw an exception here
    }
}


Of course I am just guessing.

Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting.

A man said to the universe:
"Sir I exist!"
"However," replied the universe,
"The fact has not created in me
A sense of obligation."
--Stephen Crane


GeneralRe: Validation on Data Object in Code, not XAML? Pin
MattFunke18-Feb-10 7:27
MattFunke18-Feb-10 7:27 
QuestionSensing data entry Pin
mbangh18-Feb-10 4:18
mbangh18-Feb-10 4:18 
AnswerRe: Sensing data entry Pin
Nicholas Butler18-Feb-10 4:25
sitebuilderNicholas Butler18-Feb-10 4:25 
GeneralRe: Sensing data entry Pin
mbangh18-Feb-10 4:27
mbangh18-Feb-10 4:27 
GeneralRe: Sensing data entry Pin
Nicholas Butler18-Feb-10 5:33
sitebuilderNicholas Butler18-Feb-10 5:33 
AnswerRe: Sensing data entry Pin
Ennis Ray Lynch, Jr.18-Feb-10 5:43
Ennis Ray Lynch, Jr.18-Feb-10 5:43 
QuestionProblems with Exchange WebService API Pin
DotNetCoderJunior18-Feb-10 3:34
DotNetCoderJunior18-Feb-10 3:34 
AnswerRe: Problems with Exchange WebService API Pin
DotNetCoderJunior21-Feb-10 22:07
DotNetCoderJunior21-Feb-10 22:07 
QuestionProblems showing another form when user activates the main form Pin
TheFoZ18-Feb-10 3:32
TheFoZ18-Feb-10 3:32 
AnswerRe: Problems showing another form when user activates the main form Pin
1.21 Gigawatts18-Feb-10 3:39
1.21 Gigawatts18-Feb-10 3:39 
GeneralRe: Problems showing another form when user activates the main form Pin
TheFoZ18-Feb-10 3:42
TheFoZ18-Feb-10 3:42 
QuestionFile I/O - New Line Character Pin
1.21 Gigawatts18-Feb-10 2:45
1.21 Gigawatts18-Feb-10 2:45 
AnswerRe: File I/O - New Line Character Pin
Luc Pattyn18-Feb-10 2:58
sitebuilderLuc Pattyn18-Feb-10 2:58 
GeneralRe: File I/O - New Line Character Pin
1.21 Gigawatts18-Feb-10 3:07
1.21 Gigawatts18-Feb-10 3:07 
GeneralRe: File I/O - New Line Character Pin
Luc Pattyn18-Feb-10 3:12
sitebuilderLuc Pattyn18-Feb-10 3:12 
GeneralRe: File I/O - New Line Character Pin
1.21 Gigawatts18-Feb-10 3:16
1.21 Gigawatts18-Feb-10 3:16 
GeneralRe: File I/O - New Line Character Pin
Luc Pattyn18-Feb-10 3:28
sitebuilderLuc Pattyn18-Feb-10 3:28 

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.