473,395 Members | 1,756 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

on lost focus txtCity is flickering, txtState is flickering and program freeze's

1
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtCity_GotFocus()
  2.    sForText = "txtCity"
  3. End Sub
  4.  
  5. Private Sub txtCity_LostFocus()
  6.          If txtCity = "" Then
  7.   picMsgBox.Visible = True
  8.       picMsgBox.Top = 600
  9.      picMsgBox.Left = 1560
  10.            txtMyMSG = ""
  11.            txtMyMSG = "Please Enter A City Or Township!"
  12.          Else
  13.      txtState.SetFocus
  14.      Exit Sub
  15.          End If
  16.  
  17.                       txtCity.SetFocus
Nov 24 '14 #1
1 989
twinnyfo
3,653 Expert Mod 2GB
I think the problem you are having is that every time you lose the focus on your control you are telling it to set the focus back to that control and perform more actions. It appears to be getting caught in an endless loop.....
Nov 24 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: thomaz | last post by:
I use the DataSource like below to fill a Combobox: comboBox1.DataSource = dataSet1.Tables; comboBox1.DisplayMember = "ProductName"; When the user types any keyboard key i use the DROPDOWN...
6
by: Ellis Yu | last post by:
Hi all, I've a form containing some textbox fields. I wrote a simple code to check if the field is blank in lost focus event, an msg box will be shown to remind user about it. But don't why the...
6
by: Xero | last post by:
Hi. I have created a 'stop watch' program. The working principle of the program is to declare an integer (say 'intTime'), which is initalized to zero. Once the user clicks the 'Start' button,...
0
by: Nick | last post by:
I have a situation wherein i have a text box, that has abc() being executed whenever the lost focus event is triggered. However, there is an exceptional case where, if a button click causes the...
1
by: Philipp | last post by:
Hi NG, Is there a way to know which control just lost focus when clicking on a button? (other than keeping an object variable which is set when a control loses focus)? Thanks in advance! ...
16
by: jamesnkk | last post by:
I am trying to validate a QTY entry in a form , if user did not enter anything or 0 , I will prompt for a message and the cursor return to the QTY entry column. I have tried Lost Focus in the...
0
by: Asif | last post by:
Hi all, I am working on an MDI application using VB.NET. Applications launches normally either from Program Files or Desktop shortcut but some times when it launches from Windows Explorer by...
1
by: ravikumar2007 | last post by:
I am working with .NET 3.5 framework within an WPF application. I have a windows application where for a textbox, I have defined the lost focus event. I need to call the Focus() method of any other...
3
by: muddasirmunir | last post by:
I am using the following code at mouse move event of label Now i want that when user lost focus from the label its color aging change back , on what event i want to do this code as there is no...
12
by: scrapcode | last post by:
Hi everyone, I have a sub that works fine when used with the lost focus event, but when I try and use the same sub with the change event I get the above error. I've searched the net and found lots...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.