Solved

Visual Studio 2005 VB After_Update equivalent

Posted on 2007-11-20
9
151 Views
Last Modified: 2013-11-26
Hi

What is the best equivalent of the VBA After_Update event in Visual Studio 2005 for a text box on a indows form?

Thanks
0
Comment
Question by:murbro
  • 4
  • 3
  • 2
9 Comments
 
LVL 5

Expert Comment

by:administradores
ID: 20325880
I thin it is TextChanged
0
 

Author Comment

by:murbro
ID: 20325964
Hi

That was the first thing I tried but the problem with that is that it calls the event after each character.
I need something that fires after I have type the whole word.
I am using the LostFocus event, but it is not quite the same.
Anyone know of anything else?
0
 

Author Comment

by:murbro
ID: 20325969
Actually - would the Text_Update work?
0
 

Author Comment

by:murbro
ID: 20326036
Sorry my last comment is wrong (I was looking at a combo box)
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 5

Expert Comment

by:administradores
ID: 20326111
And how do you know when the text is completed? a fixed length char? a keypress?


So i the users have to press enter you can use on keypress i it's a fixed length use textchanged and a like

if textbox.length = 10 then
your code
ebdif
0
 
LVL 5

Expert Comment

by:administradores
ID: 20326133
Update event raised after user press the return key

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
        If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Return) Then
            'Your Code to Update
Update()
        End If
    End Sub

Update event raised after user typed 10 characters

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        If Len(TextBox1) = 10 Then
            'Your Code
Update()
        End If
    End Sub
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 20326639
Have you checked the Validate event?
0
 

Author Comment

by:murbro
ID: 20327049
How does the Validate event work?
0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 20327065
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now