Solved

textbox1 gotfocus problem

Posted on 2014-10-16
3
124 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
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 69

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

910 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

19 Experts available now in Live!

Get 1:1 Help Now