473,396 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Avoid validation on cancel

Dear all,

I simple question is driving me crazy.

following lost focus of a Textbox must work all time except, when focus is
lost because a cancel button is pressed.

How can I do that?

Thanks a lot,

Boni

Private SubXX_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs)
Handles XX.LostFocus

If Not IsValid(XX.Text) Then

MsgBox.show("XXX"...)

End If

End Sub

Nov 29 '05 #1
3 2342
Why don't u try validating event???
Read the acceptbutton, acceptsreturn and cancelbutton properties of the
form and textbox and use them in ur application...

Nov 29 '05 #2
Thanks. The thing with "validating event" and error provider worked.. But
cancel still don't close the form. Could you explain
"Read cancelbutton properties".
Which property would be set if cancel button was pressed?

"vishal" <vi*************@gmail.com> schrieb im Newsbeitrag
news:11**********************@f14g2000cwb.googlegr oups.com...
Why don't u try validating event???
Read the acceptbutton, acceptsreturn and cancelbutton properties of the
form and textbox and use them in ur application...

Nov 29 '05 #3
Thanks you very much. It worked, but I have absolutely the same problem. If
I set e.cancel =true then cancel button click is ignored.How do I "Read the
cancelbutton properties"? Which property of a cancelbutton should I
evaluate in order to know that it was pressed?
"vishal" <vi*************@gmail.com> schrieb im Newsbeitrag
news:11**********************@f14g2000cwb.googlegr oups.com...
Why don't u try validating event???
Read the acceptbutton, acceptsreturn and cancelbutton properties of the
form and textbox and use them in ur application...

Nov 29 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bart Lateur | last post by:
I'd like to have validation of the inputted text, in a form textbox. I want to give the user the option to try again, or to cancel out after which the textbox is either cleared or restored. I just...
1
by: Corey Olsen | last post by:
Can anyone point me to some documentation on bypassing validation controls when a user selects cancel? What I have is a user control with a form to fill out information on a subject. The user...
3
by: news.public.microsoft.com | last post by:
Hi everyone, I have a VB.NET web form with some field validators and Save and Cancel buttons. What I want to do is on the Cancel button On_Click event, Response.Redirect to another page. The...
3
by: MB | last post by:
Hi, I am doing a project which uses asp.net to develop its forms. The form uses validation web controls to validate the data entered in text boxes. When Cancel Button is pressed which is to exit...
5
by: Chris | last post by:
Based upon some prevoius postings on what to do for adding a 'add' row to a datagrid I utilize the footer to create the 'add' row. The only issue is that I have it sharing the 'UpDate_Command' and...
5
by: Tina | last post by:
the Edit, Update, Cancel, and Delete buttons in my datagrid are causing validation elsewhere on the page. I want to specify that these buttons should not cause validation but they have no design...
5
by: Micky | last post by:
VB v7.1.3088 NET v1.1.4322 SP1 My mate has a strange problem regarding the ESC key and validation. When he hits the Cancel button on his form, the form does not validate. This is correct...
1
by: Ganesh | last post by:
Hi There, I've a validation control in my page, In some cases i don't want to check the validation like when users click cancel, i'l take the page to home page. But it checks always validation....
1
by: cwby1966 | last post by:
I am Trying to validate information entered into 4 fields on a form. They can not be empty. If one of the fields is empty then the code should give a message athen stop. If all fields are valid then...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.