Click here to Skip to main content
15,887,386 members
Home / Discussions / C#
   

C#

 
GeneralRe: ODBC Type mismatch error Pin
TheJudeDude26-Oct-09 15:41
TheJudeDude26-Oct-09 15:41 
GeneralRe: ODBC Type mismatch error Pin
Luc Pattyn26-Oct-09 15:46
sitebuilderLuc Pattyn26-Oct-09 15:46 
GeneralRe: ODBC Type mismatch error Pin
TheJudeDude27-Oct-09 3:49
TheJudeDude27-Oct-09 3:49 
AnswerRe: ODBC Type mismatch error Pin
Luc Pattyn26-Oct-09 10:05
sitebuilderLuc Pattyn26-Oct-09 10:05 
QuestionChecking required fields in a second Windows Form Pin
JTRizos26-Oct-09 8:31
JTRizos26-Oct-09 8:31 
AnswerRe: Checking required fields in a second Windows Form Pin
Not Active26-Oct-09 8:50
mentorNot Active26-Oct-09 8:50 
GeneralRe: Checking required fields in a second Windows Form Pin
JTRizos26-Oct-09 11:09
JTRizos26-Oct-09 11:09 
GeneralRe: Checking required fields in a second Windows Form Pin
Not Active26-Oct-09 11:26
mentorNot Active26-Oct-09 11:26 
Close but quite there yet.

Either use RequiredField validators for the CaseNo and Reason textboxes on Form2 or validate them in the click event.

public void button1_Click(object sender, System.EventArgs e)
{
   if(string.IsNullOrEmpty(CaseNo) || string.IsNullOrEmpty(Reason) )
   {
       MessageBox(...);
   }
   else
   {
      DialogResult = DialogResult.OK;
      Close();
   }
}


Now Form2 will not be dismissed until the fields are valid.


Also check to make sure button1 is not set as the default button for form2 or it will close the form automatically.


only two letters away from being an asset

GeneralRe: Checking required fields in a second Windows Form Pin
JTRizos26-Oct-09 11:56
JTRizos26-Oct-09 11:56 
GeneralRe: Checking required fields in a second Windows Form Pin
Not Active26-Oct-09 12:44
mentorNot Active26-Oct-09 12:44 
GeneralRe: Checking required fields in a second Windows Form Pin
JTRizos26-Oct-09 13:03
JTRizos26-Oct-09 13:03 
GeneralRe: Checking required fields in a second Windows Form Pin
CodyDaemon29-Oct-09 5:54
CodyDaemon29-Oct-09 5:54 
GeneralRe: Checking required fields in a second Windows Form Pin
JTRizos29-Oct-09 6:24
JTRizos29-Oct-09 6:24 
AnswerRe: Checking required fields in a second Windows Form Pin
_Madmatt26-Oct-09 9:43
_Madmatt26-Oct-09 9:43 
GeneralRe: Checking required fields in a second Windows Form Pin
Not Active26-Oct-09 9:59
mentorNot Active26-Oct-09 9:59 
GeneralRe: Checking required fields in a second Windows Form Pin
_Madmatt27-Oct-09 9:45
_Madmatt27-Oct-09 9:45 
GeneralRe: Checking required fields in a second Windows Form Pin
Not Active27-Oct-09 10:10
mentorNot Active27-Oct-09 10:10 
GeneralRe: Checking required fields in a second Windows Form Pin
_Madmatt27-Oct-09 10:20
_Madmatt27-Oct-09 10:20 
GeneralRe: Checking required fields in a second Windows Form Pin
Not Active27-Oct-09 10:40
mentorNot Active27-Oct-09 10:40 
QuestionRe: Checking required fields in a second Windows Form [modified] Pin
JTRizos27-Oct-09 11:49
JTRizos27-Oct-09 11:49 
AnswerRe: Checking required fields in a second Windows Form Pin
Not Active27-Oct-09 14:50
mentorNot Active27-Oct-09 14:50 
GeneralRe: Checking required fields in a second Windows Form Pin
JTRizos28-Oct-09 5:57
JTRizos28-Oct-09 5:57 
GeneralRe: Checking required fields in a second Windows Form Pin
Not Active28-Oct-09 9:20
mentorNot Active28-Oct-09 9:20 
AnswerRe: Checking required fields in a second Windows Form Pin
JTRizos29-Oct-09 11:19
JTRizos29-Oct-09 11:19 
GeneralRe: Checking required fields in a second Windows Form Pin
Not Active29-Oct-09 11:29
mentorNot Active29-Oct-09 11:29 

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.