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

C#

 
GeneralRe: No validation events when clicking on a toolbar Pin
Luis Alonso Ramos19-Oct-04 7:39
Luis Alonso Ramos19-Oct-04 7:39 
GeneralGetting active MdiChild Pin
Luis Alonso Ramos16-Oct-04 12:29
Luis Alonso Ramos16-Oct-04 12:29 
GeneralRe: Getting active MdiChild Pin
Alex Korchemniy16-Oct-04 14:45
Alex Korchemniy16-Oct-04 14:45 
GeneralRe: Getting active MdiChild Pin
Luis Alonso Ramos16-Oct-04 15:17
Luis Alonso Ramos16-Oct-04 15:17 
Generalsearch mechanism Pin
mathon16-Oct-04 9:56
mathon16-Oct-04 9:56 
GeneralRe: search mechanism Pin
Alex Korchemniy16-Oct-04 11:15
Alex Korchemniy16-Oct-04 11:15 
GeneralRe: search mechanism Pin
mathon16-Oct-04 13:06
mathon16-Oct-04 13:06 
GeneralRe: search mechanism Pin
Alex Korchemniy16-Oct-04 14:36
Alex Korchemniy16-Oct-04 14:36 
GeneralRe: search mechanism Pin
mathon16-Oct-04 22:22
mathon16-Oct-04 22:22 
GeneralRe: search mechanism Pin
mathon16-Oct-04 22:29
mathon16-Oct-04 22:29 
General[Message Deleted] Pin
Bedevian16-Oct-04 7:54
Bedevian16-Oct-04 7:54 
GeneralRe: Find String in txt file Pin
Alex Korchemniy16-Oct-04 8:56
Alex Korchemniy16-Oct-04 8:56 
GeneralConsole-Like Text Output Control Or.... Pin
osirisgothra16-Oct-04 7:34
osirisgothra16-Oct-04 7:34 
GeneralRe: Console-Like Text Output Control Or.... Pin
Alex Korchemniy16-Oct-04 8:50
Alex Korchemniy16-Oct-04 8:50 
GeneralRe: Console-Like Text Output Control Or.... Pin
Alex Korchemniy16-Oct-04 8:52
Alex Korchemniy16-Oct-04 8:52 
GeneralGDI+ - line chart Pin
xiaowenjie16-Oct-04 4:56
xiaowenjie16-Oct-04 4:56 
GeneralRe: GDI+ - line chart Pin
Kiran Satish16-Oct-04 6:11
Kiran Satish16-Oct-04 6:11 
GeneralRe: GDI+ - line chart Pin
xiaowenjie16-Oct-04 9:40
xiaowenjie16-Oct-04 9:40 
GeneralRe: GDI+ - line chart Pin
Kiran Satish16-Oct-04 18:21
Kiran Satish16-Oct-04 18:21 
GeneralRe: GDI+ - line chart Pin
Alex Korchemniy16-Oct-04 9:22
Alex Korchemniy16-Oct-04 9:22 
QuestionHow can i close my Form Pin
Zapss16-Oct-04 1:31
Zapss16-Oct-04 1:31 
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 textbox

private void txtpassword_Validating(object sender,System.ComponentModel.CancelEventArgs e)
if (txtempno.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
even button1 causes validation set false

the focus is still in of the textbox,
the validation event of the textbox 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.

How can i close my Form when user user click [X] button on the control box.
or button1??????????????????Eek! | :eek:
AnswerRe: How can i close my Form Pin
sreejith ss nair16-Oct-04 4:45
sreejith ss nair16-Oct-04 4:45 
GeneralRe: How can i close my Form Pin
Zapss16-Oct-04 20:40
Zapss16-Oct-04 20:40 
GeneralSubclass control over main class Pin
Nekosan16-Oct-04 1:00
Nekosan16-Oct-04 1:00 
GeneralRe: Subclass control over main class Pin
J4amieC16-Oct-04 2:36
J4amieC16-Oct-04 2: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.