473,661 Members | 2,464 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

textbox.leave event not firing properly

Hi,

I have a form with many textbox on it. Behind this(so to speak), is a class,
and each time the user changes the value of the text box I want to update
the relevant property of the class.

I have the class.property = txtbox.text set on the textbox.leave event, and
this works fine, except for when the user clicks on my toolbar button to
save the details to the database.

The problem is that the last text box that they where in, does not fire the
leave event, when the toolbar button is clicked.

I though a good idea was to place a hidden text box on the form, and the
first thing that happens when the user clicks the button is that i set the
focus to the hidden text box, forcing the leave event to fire on the
previous text box.

I cann't see the old VB6 setfocus event for a text box, so I though that if
I just did txtHiddenTextbo x.text = 'eee' it would work, but it seems that it
does not.

Any way aroud this, or better suggestion.

I had thought of updating the class on the keydown event, but I figured that
was not a effiecent way of doing this.

Regards

Nov 20 '05 #1
2 2821
Did you try:
txtHiddenTextBo x.Focus
--
Joe Fallon

"AussieRule s" <so*****@nowher e.com> wrote in message
news:%2******** *******@tk2msft ngp13.phx.gbl.. .
Hi,

I have a form with many textbox on it. Behind this(so to speak), is a class, and each time the user changes the value of the text box I want to update
the relevant property of the class.

I have the class.property = txtbox.text set on the textbox.leave event, and this works fine, except for when the user clicks on my toolbar button to
save the details to the database.

The problem is that the last text box that they where in, does not fire the leave event, when the toolbar button is clicked.

I though a good idea was to place a hidden text box on the form, and the
first thing that happens when the user clicks the button is that i set the
focus to the hidden text box, forcing the leave event to fire on the
previous text box.

I cann't see the old VB6 setfocus event for a text box, so I though that if I just did txtHiddenTextbo x.text = 'eee' it would work, but it seems that it does not.

Any way aroud this, or better suggestion.

I had thought of updating the class on the keydown event, but I figured that was not a effiecent way of doing this.

Regards

Nov 20 '05 #2
Did you try:
txtHiddenTextBo x.Focus
--
Joe Fallon

"AussieRule s" <so*****@nowher e.com> wrote in message
news:%2******** *******@tk2msft ngp13.phx.gbl.. .
Hi,

I have a form with many textbox on it. Behind this(so to speak), is a class, and each time the user changes the value of the text box I want to update
the relevant property of the class.

I have the class.property = txtbox.text set on the textbox.leave event, and this works fine, except for when the user clicks on my toolbar button to
save the details to the database.

The problem is that the last text box that they where in, does not fire the leave event, when the toolbar button is clicked.

I though a good idea was to place a hidden text box on the form, and the
first thing that happens when the user clicks the button is that i set the
focus to the hidden text box, forcing the leave event to fire on the
previous text box.

I cann't see the old VB6 setfocus event for a text box, so I though that if I just did txtHiddenTextbo x.text = 'eee' it would work, but it seems that it does not.

Any way aroud this, or better suggestion.

I had thought of updating the class on the keydown event, but I figured that was not a effiecent way of doing this.

Regards

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3241
by: Chris Mayers | last post by:
Hi, I have an application that has (for the sake of argument) 2 (MDI) windows open. If I click into a textbox on FormA then the 'Enter' event for that TextBox fires, great! However, if I then click on FormB, then back to FormA although the cursor is still flashing in the same textbox on FormA, when I tab out, the 'Leave' event for that TextBox does not fire. If I stay on FormA and Shift-Tab back into the textbox then the 'Enter' event...
2
6136
by: JayDee | last post by:
After a user enters data into a field, I need to populate other controls on the form, based on the user entry. I have to use either Leave, Validating or Validated, and I take it I can't use LostFocus because there is no selection for that event in the dropdown list on the code page. What's happening is that all 3 events mentioned above for the textbox control fire in the proper order when the form is invoked, but don't fire the first time...
28
4313
by: kfrost | last post by:
I know this is probably simple but I have a C# form and the class for the form is called sbaSynch. I have a textbox name txtServerName. I'm creating a class to manipulate XML functions so I added a class to project and it's named XmlApi(). In the XmlAPI() class I have simple code as following XmlAPI() { string str = "Some Text";
2
2900
by: Ben Fidge | last post by:
Hi I've got a TextBox on my WebForm with it's AutoPostback set to true, and an event handler created for the TextChanged event. I would expect this event to be fired when the user types any character into the textbox. However, the event is only firing when the users enters text and THEN moves to another control on the page.
1
2894
by: Zyrthofar | last post by:
Hi I have three textboxes indicating the individual RGB values of a color. When the user leaves a textbox (Leave event), I check the validity of that number and saves the three values to a set of raw data... The sub used handles the three textboxes's Leave events, and uses the 'sender' variable... Now I have a picturebox with GDI+ circles in it, representing the 8 different colors in the palette. You can choose the color number by...
4
22762
by: miss_kait | last post by:
I would like to emulate the afterupdate event in vb.net after scanning a barcode. I have multiple barcodes to scan and after each scan I would like focus to move to the next text box. I have mainly stuck with the Key press/down/up events. The wedge scanner is programmed for a 'return' keystroke after a scan. Only the first char of the barcode is printing in the text box and then the focus moves to the next text box.
3
4016
by: William E Voorhees | last post by:
I have code (using the leave event) in a textbox which prevents the user from leaving the box if it is blank. I would like the user to be able to click on the button of the form and close that form without firing the leave event in that text box. An answer would be helpful. Thanks, Bill
0
1099
by: Syed81 | last post by:
Hi All, I have used one textbox inside datagrid's itemtemplate.During its textchanged event i have did some calculations in code behind using add handler.I have set autopostback=true.But its textchanged event is not firing when i move to the next cell.But for another textbox in the same row it is firing. Anybody plz give me the solution Regards Syed
1
2055
by: madhanmss | last post by:
Hi, i have two textboxes to enter the start and end dates. I am using javascript calendar to populate these text boxes. Based on the chosen date values, i need to filter a treeview control. The problem is, the ontextchanged event of the textbox is not firing, when the date is chosen from the javascript calendar. If you enter the date directly into the textbox, the event is firing. I need to find out how to fire the ontextchanged...
0
8432
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8343
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8545
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7364
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6185
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5653
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1743
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.