Solved

Visual Studio 2005 VB After_Update equivalent

Posted on 2007-11-20
9
155 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

 

Author Comment

by:murbro
ID: 20326036
Sorry my last comment is wrong (I was looking at a combo box)
0
 
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 70

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 70

Accepted Solution

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

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…

752 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