[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to create a Leave event for a Text Box

Posted on 2004-11-14
1
Medium Priority
?
229 Views
Last Modified: 2012-08-13
I need to create a leave event for a text box called txtZoneA

Once the user leaves the text box I will be required to validate the data in the text box.


Thanks
0
Comment
Question by:Stella Pauley
1 Comment
 
LVL 2

Accepted Solution

by:
GohdanTheMoblin earned 1200 total points
ID: 12581000
Very basic outline:

    Private Sub txtZoneA_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtZoneA.Leave
        If DataIsValid() Then
            'do whatever
        Else
            'Do what you need to let the user know the data is invalid
            txtZoneA.Focus()
        End If
    End Sub

Replace "DataIsValid()" with whatever logic is used to determine what data is valid.  The Focus call in the else clause doesn't let the user leave the TextBox unless the input is valid, take it out if this is not your desired behavior.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month19 days, 7 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question