Click here to Skip to main content
15,925,895 members
Home / Discussions / C#
   

C#

 
GeneralRe: Click event problem Pin
James T. Johnson29-Dec-02 19:15
James T. Johnson29-Dec-02 19:15 
GeneralRe: Click event problem Pin
Nick Parker30-Dec-02 1:22
protectorNick Parker30-Dec-02 1:22 
GeneralRe: Click event problem Pin
Nick Parker30-Dec-02 1:29
protectorNick Parker30-Dec-02 1:29 
Generalopening a default file browser of sorts Pin
jtmtv1829-Dec-02 12:51
jtmtv1829-Dec-02 12:51 
GeneralRe: opening a default file browser of sorts Pin
jtmtv1829-Dec-02 13:05
jtmtv1829-Dec-02 13:05 
GeneralRe: opening a default file browser of sorts Pin
Nick Parker29-Dec-02 14:33
protectorNick Parker29-Dec-02 14:33 
QuestionHave someone www.learnvisualstudio.net videos? Pin
gicio29-Dec-02 11:33
gicio29-Dec-02 11:33 
Question[C#] Validation class for events? Pin
gicio29-Dec-02 11:32
gicio29-Dec-02 11:32 
Hi,

I develop an application that have 20 windows forms with many TextBoxes.
All TextBoxes have the same validation...
I write in all classes the same validation like that:



[CODE]
//if the user press a key down at txtDisplacement we check which one was pressed down
#region KeyDownInTxtDisplacement code
private void KeyDownInTxtDisplacement(object sender, System.Windows.Forms.KeyEventArgs e)
{
CheckWhichKeyDown(e);
}
#endregion



//if the user press a key down at txtModel we check which one was pressed down
#region KeyDownInTxtModel code
private void KeyDownInTxtModel(object sender, System.Windows.Forms.KeyEventArgs e)
{
CheckWhichKeyDown(e);
}
#endregion



//we check which key is pressed
//if key Enter or Return or Tab is pressed
//we go throw DoWhenOneTextBoxIsMarkedRed()
#region CheckWhichKeyDown code
private void CheckWhichKeyDown(System.Windows.Forms.KeyEventArgs e)
{
if(e.KeyCode==Keys.Enter || e.KeyCode==Keys.Return || e.KeyCode==Keys.Tab)
{
ValidateThis();
}
}
#endregion



//when special key is press we enable the button
#region ValidateThis code
private void ValidateThis()
{
cmdAddToDataBase.Enabled = true;
}
#endregion
[/CODE]




CheckWhichKeyDown and ValidateThis should be in one validation class.
How I can write a validation class that validate ALL TextBoxes from all classes.
Any ideas?
Or do you know some sample validation classes available on www?


gicio
AnswerRe: [C#] Validation class for events? Pin
Nick Parker29-Dec-02 14:24
protectorNick Parker29-Dec-02 14:24 
GeneralRe: [C#] Validation class for events? Pin
gicio30-Dec-02 6:18
gicio30-Dec-02 6:18 
GeneralRe: [C#] Validation class for events? Pin
Nick Parker30-Dec-02 6:18
protectorNick Parker30-Dec-02 6:18 
GeneralRe: [C#] Validation class for events? Pin
gicio30-Dec-02 7:31
gicio30-Dec-02 7:31 
GeneralRe: [C#] Validation class for events? Pin
gicio2-Jan-03 7:40
gicio2-Jan-03 7:40 
GeneralLooking for other developer boards Pin
gicio29-Dec-02 11:31
gicio29-Dec-02 11:31 
GeneralLooking for developer videos/demos/webcasts tutorials Pin
gicio29-Dec-02 11:30
gicio29-Dec-02 11:30 
GeneralRe: Looking for developer videos/demos/webcasts tutorials Pin
Anonymous25-Feb-03 4:15
Anonymous25-Feb-03 4:15 
GeneralReflection and 'ref' parameter Pin
29-Dec-02 1:03
suss29-Dec-02 1:03 
GeneralRe: Reflection and 'ref' parameter Pin
Anonymous29-Dec-02 7:41
Anonymous29-Dec-02 7:41 
QuestionModal Windows? Pin
gekoscan28-Dec-02 22:47
gekoscan28-Dec-02 22:47 
AnswerRe: Modal Windows? Pin
Stephane Rodriguez.28-Dec-02 23:36
Stephane Rodriguez.28-Dec-02 23:36 
GeneralUmm... same error Pin
gekoscan29-Dec-02 2:03
gekoscan29-Dec-02 2:03 
GeneralInsite on what i am trying to accomplish Pin
gekoscan29-Dec-02 2:10
gekoscan29-Dec-02 2:10 
GeneralRe: Insite on what i am trying to accomplish Pin
Stephane Rodriguez.29-Dec-02 3:30
Stephane Rodriguez.29-Dec-02 3:30 
GeneralMore Insite and thank you. Pin
gekoscan29-Dec-02 9:58
gekoscan29-Dec-02 9:58 
GeneralRe: More Insite and thank you. Pin
Stephane Rodriguez.29-Dec-02 20:36
Stephane Rodriguez.29-Dec-02 20:36 

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.