Solved

Visual Studio 2005 VB After_Update equivalent

Posted on 2007-11-20
9
150 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
Comment Utility
I thin it is TextChanged
0
 

Author Comment

by:murbro
Comment Utility
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
Comment Utility
Actually - would the Text_Update work?
0
 

Author Comment

by:murbro
Comment Utility
Sorry my last comment is wrong (I was looking at a combo box)
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 5

Expert Comment

by:administradores
Comment Utility
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
Comment Utility
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
Comment Utility
Have you checked the Validate event?
0
 

Author Comment

by:murbro
Comment Utility
How does the Validate event work?
0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
Comment Utility
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

8 Experts available now in Live!

Get 1:1 Help Now