Click here to Skip to main content
15,924,507 members
Home / Discussions / C#
   

C#

 
GeneralSomeone please bail me out.... Pin
Vodstok13-Oct-04 3:58
Vodstok13-Oct-04 3:58 
GeneralRe: Someone please bail me out.... Pin
benjymous13-Oct-04 5:10
benjymous13-Oct-04 5:10 
GeneralRe: Someone please bail me out.... Pin
Vodstok13-Oct-04 6:30
Vodstok13-Oct-04 6:30 
GeneralRe: Someone please bail me out.... Pin
J4amieC13-Oct-04 7:47
J4amieC13-Oct-04 7:47 
GeneralRe: Someone please bail me out.... Pin
Vodstok13-Oct-04 8:25
Vodstok13-Oct-04 8:25 
GeneralRe: Someone please bail me out.... Pin
benjymous13-Oct-04 20:52
benjymous13-Oct-04 20:52 
Generalproblem with measureString in textBox Pin
shimritb13-Oct-04 3:40
shimritb13-Oct-04 3:40 
GeneralForm Causesvalidation property Pin
Zapss13-Oct-04 3:10
Zapss13-Oct-04 3:10 
Hello,
Iam new to c#
My Problem is something like this.

Create a sample windows application, having 2 textboxes & a command
button
Set the forms controlbox property to True

Write validation event for the 2 textboxes

private void txtpassword_Validating(object sender,System.ComponentModel.CancelEventArgs e)
if (txtempno.Text=="" | txtpassword.Text=="")
{
MessageBox.Show("Please Enter User Id and password","Invalid Data",MessageBoxButtons.OKCancel);
e.Cancel = true;
}

while running the application when the user clicks the button1
the focus is still in 1 of the textboxes, the validation event of the textboxes still fire.

Same is the case when the user clicks the X button on the control box.

i.e validation event is fired and form is not closed

Form Causesvalidation property aslo set flase.

if i write the code in the Form1_closing event then also the problem is not being solved.

This is because the validation event of the textboxes is fired first so the execution never reaches the Form1_closing event.

i need to provide this funcationality in my application,How can i do this?
GeneralRe: Form Causesvalidation property Pin
J4amieC13-Oct-04 3:18
J4amieC13-Oct-04 3:18 
General.NET Remoting Pin
Wender Oliveira13-Oct-04 2:48
Wender Oliveira13-Oct-04 2:48 
GeneralShifiing of custom controls from one to other machine Pin
Itanium13-Oct-04 1:38
Itanium13-Oct-04 1:38 
GeneralRe: Shifiing of custom controls from one to other machine Pin
Wender Oliveira13-Oct-04 2:50
Wender Oliveira13-Oct-04 2:50 
GeneralC++ and MFC -> .net and C# advice Pin
pixor13-Oct-04 0:31
pixor13-Oct-04 0:31 
GeneralRe: C++ and MFC -> .net and C# advice Pin
J4amieC13-Oct-04 0:52
J4amieC13-Oct-04 0:52 
GeneralRe: C++ and MFC -> .net and C# advice Pin
Salil Khedkar13-Oct-04 20:45
Salil Khedkar13-Oct-04 20:45 
GeneralRe: C++ and MFC -> .net and C# advice Pin
pixor13-Oct-04 22:46
pixor13-Oct-04 22:46 
GeneralIs it possible to use server.mappath in class file Pin
Irsh13-Oct-04 0:19
Irsh13-Oct-04 0:19 
GeneralRe: Is it possible to use server.mappath in class file Pin
Vasudevan Deepak Kumar13-Oct-04 2:29
Vasudevan Deepak Kumar13-Oct-04 2:29 
GeneralUse of GAC and registry Pin
ting66812-Oct-04 23:57
ting66812-Oct-04 23:57 
GeneralRe: Use of GAC and registry Pin
Vasudevan Deepak Kumar13-Oct-04 0:01
Vasudevan Deepak Kumar13-Oct-04 0:01 
GeneralPrinter Name Pin
lighting_blue12-Oct-04 23:34
lighting_blue12-Oct-04 23:34 
GeneralAbout time stamp Pin
wk_vigorous12-Oct-04 22:51
wk_vigorous12-Oct-04 22:51 
GeneralRe: About time stamp Pin
Anonymous12-Oct-04 23:31
Anonymous12-Oct-04 23:31 
GeneralDataGrid not showing Date & Time Pin
StrayGrey12-Oct-04 21:36
StrayGrey12-Oct-04 21:36 
GeneralRe: DataGrid not showing Date & Time Pin
Colin Angus Mackay12-Oct-04 23:58
Colin Angus Mackay12-Oct-04 23:58 

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.