Solved

textbox1 gotfocus problem

Posted on 2014-10-16
3
128 Views
Last Modified: 2014-10-17
Hi Experts
I have the following code


    Private Sub ModelBox_GotFocus(sender As Object, e As EventArgs) Handles ModelBox.GotFocus      
        MsgBox("wait")
    End Sub

When the mailbox gets the focus
It loops for 30 times
I do not understand why


it should only display wait messagebox once


Please help
0
Comment
Question by:b001
[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
3 Comments
 
LVL 21

Assisted Solution

by:Randy Poole
Randy Poole earned 167 total points
ID: 40385176
well it looses focus when the messagebox is show and regains focus when you close it, so it is basically a loop
0
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 166 total points
ID: 40385780
a msgbox is not a good idea in this case as explained by Randy.

why do you need to put this msgbox there? if it is only to trace it, set a label with the current time and it won't steal the focus
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 167 total points
ID: 40385880
Use the Enter event instead. It is called when the control first receives the focus, but won't trigger again unless the cursor moves to another control on the form and comes back. The MessageBox thus have no effect on it.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

705 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